def main():
  s = input()
  
  answer = 0
  
  while (not "0" in s) or (not "1" in s):
    answer += s.count("10")
    s.replace("10", "")
    answer += s.count("01")
    s.replace("01", "")
  
  print(answer)


if __name__ == "__main__":
  main()
