i = input()

prev = ""
res = 0
index = 0
col = []
while index < len(i):
    temp = i[index]
    if temp == prev:
        prev = i[index:index+2]
	if index == len(i)-1:
            res -= 1
	index += 2

    else:
        prev = temp
        index += 1
    col.append(prev)
    res += 1

print(res)