S = input()
N = len(S)

dp = [0 for _ in range(N)]

dp[0] = 1
dp[1] = 1

for i in range(2, N):
    if S[i] != S[i - 1]:
        dp[i] += dp[i - 1] + 1
    else:
        dp[i] += dp[i - 3] + 2

print(dp[N - 1])
