def min_operations_to_good_string(n, s): ops = 0 i = 0 while i < n - 1: if s[i] == '0' and s[i + 1] == '0': ops += 1 i += 2 else: i += 1 return ops n = int(input()) s = input().strip() print(min_operations_to_good_string(n, s))