n = input() input_number = n.count("0") right_number = "1000000007".count("0") print(abs(input_number-right_number))