import decimal,math
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 10
s=raw_input()
res=1
pre=s[0]
cur=""
for i in range(1,len(s)):
	cur=cur+s[i]
	if(cur!=pre):
		res=1+res
		pre=cur
		cur=""
	# print cur,pre	
print res