import re input() print(sum([len(c) // 2 for c in re.findall("0+", input())]))