n = int(input()) s = list(input()) result = 0 for i in range(n): if s[i] == '0' and i + 1 < n and s[i + 1] == '0': result += 1 s[i + 1] = '1' elif s[i] == '1' and 0 < i < n - 1 and s[i - 1] == '0' and s[i + 1] == '0': result += 1 s[i + 1] = '1' print(result)