eolymp
bolt
Try our new interface for solving problems
Problems

Length of the sequence

Length of the sequence

Given a sequence of nonnegative integers ending with number 0. After reading zero, the program must terminate its work and output the amount of read number, not including the final zero. The numbers following 0, is not necessary to read.

Input

Sequence of non-negative integers, each written in a separate line.

Output

Print the amount of numbers in the sequence before the first zero.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1
7
9
0
5
Output example #1
3