Panel

Smith is an electrical engineer and today he is dealing with a bulb panel made up of a row of N consecutive identical bulbs. Each bulb can either be on (state represented by single a 1 bit) or off (state represented by single a 0 bit). He gives you array of N bits representing the state of the bulbs on the panel. Because two consecutive bulbs which are on create enough heat in order to cause costly malfunctions, Smith was ordered to change the state of some bulbs in order to eliminate the probability of such technical problems. He knows how difficult, time consuming and dangerous is turning on an off bulb or turning off of an on bulb, so he wants to complete his task with minimum number of state changes. You are to tell him what's the minimum number of changes he needs to perform on the bulb panel in order to acomplish his job.

Input

On the first line of the input is a single number N (1<=N<=32000). The second line of the input contains N numbers from the set {0,1} representing the state of the bulbs in the manner described in the problem statement, separed by a single space between each 2 consecutive numbers. Each line of the input ends by a newline character.

Output

The only line of the output should contain a single number, the answer to Smith's problem (this line should also end with a newline character, succeeding the required answer).

Sample

InputOutput
4
1 0 1 1
1

Explanation

Smith will turn off the 4-th bulb (1-based, left to right indexing of the given array).
Questions?

Sponsors Gold