def min_operations_to_good_string(n, s): operations = 0 i = 0 while i < n - 1: if s[i] == '0' and s[i + 1] == '0': # Start of a block of violating 0s start = i while i + 1 < n and s[i + 1] == '0': i += 1 length = i - start + 1 operations += (length + 1) // 2 # ceil(length / 2) i += 1 else: i += 1 return operations if __name__ == "__main__": n = int(input()) s = input().strip() min_operations_to_good_string(n, s)