import sys def solve(): n = int(sys.stdin.readline()) s = list(sys.stdin.readline().strip()) count = 0 i = 0 # n-1 まで while i < n - 1: # "010" をチェック if i + 2 < n and s[i] == '0' and s[i+1] == '1' and s[i+2] == '0': s[i+2] = '1' count += 1 # "00" をチェック elif i + 1 < n and s[i] == '0' and s[i+1] == '0': s[i+1] = '1' count += 1 # 次の開始位置へ i += 1 print(count) if __name__ == "__main__": solve()