Under construction

Still being built. Things may change

Only Three!

Interview

Time limit1sMemory limit256 MB

Summary
Count how many length-3 windows of a digit string are strictly increasing and are not extended to a run of four or more consecutive digits.
Level

Easy3 of 10

Topics
String, Implementation, Simulation, Array
Solved
No attempts yet

Problem

Given a string SS of digits, each between 0 and 9 inclusive, print how many times three consecutive digits appear. If four or more digits are consecutive, none of their parts count, and the three consecutive digits must be in increasing order.

Input

The first line gives the string SS. (3≤∣S∣≤1003 \le |S| \le 100)

Output

Print the number of times three consecutive digits appear.

Hint

Consider 23123856782467392. Here 123 and 567 are consecutive digits. However, 5678 has 8 attached after 567, so four digits are consecutive; excluding it, only 123 is the answer.

Examples1

  1. Example 1

    Input
    1231234123
    
    Expected output
    2