There is a house with $n$ flats situated on the main street of Berlatov. Vova is watching this house every night. The house can be represented as an array of $n$ integer numbers $a_1, a_2, \dots, a_n$, where $a_i = 1$ if in the $i$-th flat the light is on and $a_i = 0$ otherwise.

Vova thinks that people in the $i$-th flats are disturbed and cannot sleep if and only if $1 < i < n$ and $a_{i - 1} = a_{i + 1} = 1$ and $a_i = 0$.

Vova is concerned by the following question: what is the minimum number $k$ such that if people from exactly $k$ pairwise distinct flats will turn off the lights then nobody will be disturbed? Your task is to find this number $k$.


-----Input-----

The first line of the input contains one integer $n$ ($3 \le n \le 100$) — the number of flats in the house.

The second line of the input contains $n$ integers $a_1, a_2, \dots, a_n$ ($a_i \in \{0, 1\}$), where $a_i$ is the state of light in the $i$-th flat.


-----Output-----

Print only one integer — the minimum number $k$ such that if people from exactly $k$ pairwise distinct flats will turn off the light then nobody will be disturbed.


-----Examples-----
Input
10
1 1 0 1 1 0 1 0 1 0

Output
2

Input
5
1 1 0 0 0

Output
0

Input
4
1 1 1 1

Output
0



-----Note-----

In the first example people from flats $2$ and $7$ or $4$ and $7$ can turn off the light and nobody will be disturbed. It can be shown that there is no better answer in this example.

There are no disturbed people in second and third examples.

Difficulty: introductory

Starter code:

Solutions:
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(1, n - 1):
    if a[i - 1] == 1 and a[i] == 0 and a[i + 1] == 1:
        a[i + 1] = 0
        ans += 1
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
k = 0
for i in range(2, n):
	if a[i - 1] == 0 and a[i - 2] == 1 and a[i] == 1:
		a[i] = 0
		k += 1
print(k)


n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(1, n-1):
    if(a[i] == 0 and a[i-1]==1 and a[i+1]==1):
        ans+=1
        a[i+1] = 0
print(ans)

n = int(input())
a = list(map(int,input().split()))
c1,c2 = 0,0
for i in range(1,n-1):
    if a[i-1] == 1 and a[i] == 0 and a[i+1] == 1:
        c1+=1
for i in range(1,n-1):
    if a[i-1] == 1 and a[i] == 0 and a[i+1] == 1:
        c2+=1
        a[i+1] = 0
print(min(c1,c2))


n = int(input())
T = input().split(' ')
for i in range(n):
    T[i] = int(T[i])
m = 0
for i in range(1, n-1):
    if T[i-1]==1 and T[i]==0 and T[i+1] == 1:
        m+=1
        T[i+1] = 0
print(m)


#from operator import itemgetter
#int(input())
#map(int,input().split())
#[list(map(int,input().split())) for i in range(q)]
#print("YES" * ans + "NO" * (1-ans))
n =  int(input())
ai = list(map(int,input().split()))
ans = 0
for i in range(2,n):
    if ai[i-2] == ai[i] and ai[i] == 1 and ai[i-1] == 0:
        ai[i] = 0
        ans += 1
print(ans)


n=int(input())
A=list(map(int,input().split()))

ANS=0
for i in range(1,n-1):
    if A[i-1]==1 and A[i]==0 and A[i+1]==1:
        ANS+=1
        A[i+1]=0

print(ANS)
    


t = int(input())
s = input()
n = s.count('1 0 1')
print(n)


n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(1,n-1):
    if a[i-1]==1 and a[i]==0 and a[i+1]==1:
        a[i+1]=0
        s+=1
print(s)


n = int(input())
l = list(map(int,input().split()))
k = 0
for i in range(2,n):
	if (l[i-2]==1 and l[i]==1 and l[i-1]==0):
		l[i] = 0
		k+=1
print(k)

def solve():
    N = int(input())
    
    A = [int(k) for k in input().split()]
    
    res = 0
    
    for i in range(1,N-1):
        if A[i] == 0 and A[i-1] == A[i+1] == 1:
            A[i+1] = 0
            res += 1
            
    print (res)

solve()

n = int(input())
a = input().split()
s = 0
i = 0
for i in range(n - 2):
	if a[i] == '1' and a[i + 1] == '0' and a[i + 2] == '1':
		a[i + 2] = '0'
		s += 1
print(s)

n = int(input())
A = list(map(int,input().split()))

ans = 0
for i in range(1, n-1):
  if A[i] == 0 and A[i-1] == 1 and A[i+1] == 1:
    A[i+1] = 0
    ans += 1

print(ans)


n = int(input())
l = [*map(int, input().split())]
res = 0
for i in range(2, n):
    if l[i]:
        if l[i - 2] == l[i] and l[i - 1] == 0:
            l[i] = 0
            res += 1
print(res)

n = int(input())
a = list(map(int, input().split()))
num = 0
for i in range(2, n):
    if a[i] == 1 and a[i - 1] == 0 and a[i - 2] == 1:
        a[i] = 0
        num += 1

print(num)

n = int( input() )
a = list( map( int, input().split() ) )

ans = 0

for i in range(1,n-1):
    if a[i-1] == a[i+1] == 1 and a[i] == 0:
        a[i+1] = 0
        ans += 1

print( ans )


import math
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(2,n-2):
    if(l[i]==1 and l[i-1]==0 and l[i-2]==1 and l[i+1]==0 and l[i+2]==1):
        l[i]=0
        ans+=1
for i in range(1,n-1):
    if(l[i]==0 and l[i-1]==1 and l[i+1]==1):
        ans+=1
print(ans)

n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(1,n-1):
    if a[i-1]==1 and a[i]==0 and a[i+1]==1:
        a[i+1]=0
        c+=1
print(c)


# use this as the main template for python problems
from collections import Counter

def solution(n, a):

    count = 0
    ind = 1
    while(ind < n-1):
        if(a[ind] == 0 and a[ind-1] == 1 and a[ind+1] == 1):
            a[ind+1] = 0
            ind = 1
            count += 1 
        ind += 1
    print(count)

def __starting_point():

    # single variables
    n = [int(val) for val in input().split()][0]

    # vectors
    arr = [int(val) for val in input().split()]

    # solve it!
    solution(n, arr)

__starting_point()

n = int(input())
a = [int(d) for d in input().split()]
k=0
for x in range(1 , n-1):
    if(a[x-1] == a[x+1] and a[x-1] == 1 and a[x] == 0):
        a[x+1] = 0
        k+=1
print(k)


n = int(input())
u = list(map(int, input().split()))
ans = 0
for i in range(1, n - 1):
    if u[i] == 0 and u[i - 1] == 1 and u[i + 1] == 1:
        ans += 1
        u[i + 1] = 0
print(ans)


#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, = getIntList()
za = getIntList()

re = 0

for i in range(1,N-1):
    if za[i]==0 and za[i-1] ==1 and za[i+1] ==1:
        re+=1
        za[i+1] =0

#print(N)
print(re)        








# your code goes here
n = int(input())

a = list(map(int,input().split()))

ans = 0
for i in range(1,n-1):
	if a[i] == 0 and a[i-1] == 1 and a[i+1] == 1:
		ans += 1
		a[i+1] = 0

print(ans)

3.5

n = int(input())
A = [int(s) for s in input().split(" ") if s != ""]
ret = 0

for i in range(1, len(A)-1):
    if A[i] == 0 and A[i-1] == 1 and A[i+1] == 1:
        A[i+1] = 0
        ret += 1

print(ret)


n = int(input())
A = list(map(int, input().split()))
count = 0

for i in range(1, len(A) - 1):
    if A[i] == 0 and A[i - 1] == 1 and A[i + 1] == 1:
        A[i + 1] = 0
        count += 1

print(count)