import sys
def input():
    return sys.stdin.readline()[:-1]
s=input()

ans=1
mae=0
for i in range(len(s)-1):
    if mae:
        mae-=1
        continue
    if s[i]==s[i+1]:
        mae=1
        ans+=1
    else:
        ans+=1
print(ans)