S = input().strip() count = 0 prev = None for c in S: if prev is None: count += 1 else: if c != prev: count += 1 prev = c print(count + 1)