N=int(input()) S=list(map(int, input())) ans=0 p=0 for i in S: if i == 0: p += 1 if p == 2: ans += 1 p = 0 print(ans)