s = str(input())
cnt = 1
x = s[0]
i = 1

if len(s) == 1:
    print(1)
elif len(s) == 2:
    if s[0] == s[1]:
        print(1)
    else:
        print(2)
else:       
    while i <= len(s)-2:
        if s[i] != x:
            x = s[i]
            i += 1
            cnt += 1
         
        else:
            x = s[i:i+2]
            i += 2
            cnt += 1
           
    if s[len(s)-1] != x:
        cnt += 1
    print(cnt)
