#coding: utf-8
s = str(input())
ans = 1
flg = 0

for i in range(len(s)-1):
	# print(str(r)+","+str(l))
	if flg == 1:
		# print("aa")
		ans = ans+1
		flg = 0
	elif s[i] != s[i+1]:
		# print(i)
		ans = ans+1
	else:
		# ans = ans+1
		flg = 1
	# print(str(i)+" "+str(ans))
if flg == 1:
	ans = ans+1

print(ans)
