S = input()
S0 = S[-1]
i = -1
j = 0
ans = 1

while i > -len(S) + 1:
    if S0 != S[i + j - 1:i]:
        S0 = S[i + j - 1:i]
        ans = ans + 1
        i = i - 1 + j
        j = 0
    else:
        j = j - 1

print(ans)