s = input()
i = 1; a = 0; n = 1
while i < len(s):
    if a == 0 and s[i-1] == s[i]:
        a = 1; i += 2; n += 1
    else:
        a = 0; i += 1; n += 1
        if i == len(s)-2 and s[i] == s[i+1]: n -= 1
print(n)