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