def bunkatu(s):
    s = list(s)
    res = int(len(s))
    ans = list(s[0])
    for i in range(1,res ):
        if(s[i] != "A"):
            if(ans[-1] != s[i]):
                ans.append(s[i])
                s[i] = "A"
            else:
                if(s[i]==s[-1]):
                    ans[-1] += s[i]
                else:
                    ans.append(s[i]+s[i+1])
                    s[i+1] = "A"
        else:
            continue
    return len(ans)

s = input()

print(bunkatu(s))