eolymp
bolt
Try our new interface for solving problems
Problems

Find a sequence

Find a sequence

The integers from 0 to 9 are given. Read the numbers until the first three consecutive numbers appear.

Input

Each line contains one digit 0, 1, 2, ..., 9.

Output

Print the number of readings until the first three consecutive numbers appear.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3
6
5
6
7
2
Output example #1
5