import copy

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

old = S[0]
new = S[1]
count = 0
    
for i in range(2, len(S)-1):
    if old == new == S[i]:
        old = copy.copy(new)
        new = S[i]
    else:
        old = copy.copy(new)
        new = S[i]
        count += 1
    
print(count+1)