
S = input()

now = S[0]
i = 1
mozi_list = [now]
num = 1
while i < len(S):
	#print(i, mozi_list)
	if i != len(S) - 1:
		if len(now) == 1:
			if now != S[i]:
				now = S[i]
				mozi_list.append(now)
				i += 1
				num += 1
			else:
				now = S[i:i + 2]
				mozi_list.append(now)
				i += 2
				num += 1
		if len(now) == 2:
			now = S[i]
			mozi_list.append(now)
			i += 1
			num += 1
	else:
		if len(now) == 2:
			now = S[i]
			mozi_list.append(now)
			i += 1
			num += 1
		elif now != S[i]:
			now = S[i]
			mozi_list.append(now)
			i += 1
			num += 1
		else:
			i += 1

print(num)