S = input().strip() if not S: print(1) else: count = 1 # Initial state prev = S[0] count += 1 # First operation is always new for c in S[1:]: if c != prev: count += 1 prev = c else: prev = c print(count)