S = input()
S = list(S)

ans = 1
pre = S[0]
c = 1

while 1:
    if c == len(S)-1:
        if S[c] == pre:
            break
        else:
            ans += 1
            break

    if S[c] == pre:
        pre = S[c]+S[c+1]
        ans += 1
        c += 2
    else:
        pre = S[c]
        ans += 1
        c += 1

print(ans)
