s = input()

ans = 1
cur = 0
tmp = s[0]

for i in range(len(s)-1):
    #print(cur)
    if cur >= len(s)-2:
        if tmp == s[cur+1]:
            break
        else:
            ans += 1
            break
    if tmp == s[cur+1]:
        tmp = s[cur+1] + s[cur+2]
        cur += 2
        ans += 1
    else:
        tmp = s[cur+1]
        cur += 1
        ans += 1
        
print(ans)