def min_operations_to_good_string(n, s): operations = 0 i = 0 while i < n: if s[i] == '0': j = i while j < n and s[j] == '0': j += 1 length = j - i if length >= 2: operations += (length + 1) // 2 i = j else: i += 1 return operations if __name__ == "__main__": n = int(input()) s = input().strip() min_operations_to_good_string(n, s)