n = int(input()) s = input().strip() count = 0 i = 0 while i < len(s) - 1: if s[i] == '0' and s[i+1] == '0': count += 1 i += 2 # skip next to avoid overlapping else: i += 1 print(count)