S = list(input())
print(S)

new = S[0]
count = 0

for i in range(1, len(S)-1):
    if new != S[i] or (new == S[i] and S[i] != S[i+1]):
        new += S[i]
        count = count + 1
        
    else:
        new = S[i]
        #count = count + 1

if new == S[-1]:
    pass

else:
    count = count + 1
    
print(count+1)