s = list(input())
count = 0
check = 0
tem = str()

for i in range(0,len(s)):
    if check >0:
        check -= 1
        count += 1
    if check != 0:
        count -= 1
        continue
    if tem == "" or tem != s[i] :
        count += 1
        tem = s[i]
    else:
        check = 2
        tem = str()
print(count)