from collections import Counter
import math
import statistics
import itertools
# a,b=map(int,input().split())
b=list(input())
# c=[]
# for i in a:
#     c.append(int(i))
# A,B,C= map(int,input().split())
# f = list(map(int,input().split()))
#g = [list(map(lambda x: '{}'.format(x), list(input()))) for _ in range(a)]
# h = []
# for i in range(a):
#     h.append(list(map(int,input().split())))
# a = [[0] for _ in range(H)]#nizigen
# lis=[input() for i in range(a)]
count=len(b)
ans=[b[0]]
for i in range(len(b)-2):
    if ans[i]==b[i+1]:
        count-=1
        ans.append(b[i+1]+b[i+2])
    else:
        ans.append(b[i+1])

print(count)
