S = input()
ans = 1
tmp = S[0]
for i in range(len(S)-1):
    if tmp == S[i+1]:
        tmp += S[i+1]
    else:
        tmp = S[i+1]
        ans += 1
if ans <= len(S)/2:
    print((len(S)//2)+1)
else:
    print(ans)