s = input()
count = 0
i = 0
n = len(s)
check = False
while True:
    if check:
        count += 1
    elif s[i] != s[i+1]:
        count += 1
    else:
        i += 1
        count += 1
    if i+2 >= n:
        count += 1
        break
    i += 1
print(count)