S = str(input()) N = len(S) ans = 2 now = S[0] for i in range(1,N): if now == S[i]: continue ans += 1 now = S[i] print(ans)