the natural number is represented by the number of times the pattern "100" appears in the sequence.
For example, in the sequence 11101001010011110 the pattern appears twice and in the sequence 11101010111110111010101 it does not appear at all. You must implement a program that, given the sequence of zeros and ones, calculates how many times the pattern "100" appears in it.
Input
The first line of the input contains an integer NN, the length of the string. The second line contains the sequence of NN zeros and ones, separated by white space.
Exit
Your program must print an integer, how many times the pattern "100" appears in the sequence.