s = input()
count = 1
if(s[0] == s[1]):
    ind = 1
else:
    ind = 0
prev = s[0 : ind + 1]
i = ind + 1
while(i < len(s)):
    if(s[i] != prev):
        prev = s[i]
        count = count + 1
    else:
        prev = s[i : i + 2]
        i = i + 1
        count = count + 1
    i = i + 1
print(count)