def main():
  s=str(input())
  before=""
  count=0
  for now in s:
    if now!=before:
      before=now
      count+=1
    else:
      before+=now
    
  print(count)
  
if __name__=="__main__":
  main()