S = input()
idx = 1
count = 0
S_b = S[0]

while True:
    if idx == len(S)-1:
        break
    S_a = S[idx]
    if S_a == S_b:
        count += 1
        S_b = S[idx:idx+2]
    else:
        S_b = S_a
    idx += 1
print(len(S)-count)