def min_operations_to_good_string(n, s): operations = 0 zero_count = 0 one_count = 0 for char in s: if char == '0': zero_count += 1 else: one_count += 1 # If 0s exceed 1s, we need to flip one 0 to 1 if zero_count > one_count: operations += 1 zero_count -= 1 # flip a 0 to 1 one_count += 1 print(operations) # Reading input if __name__ == "__main__": n = int(input()) s = input().strip() min_operations_to_good_string(n, s)