Sn = gets.chomp.split("")

k = 0

prev = Sn[0]
current = ''

k = 1
i = 1
N = Sn.length
while i < N do
	current += Sn[i]

	if prev != current then
		k = k + 1
		prev = current
		current = ''
	end

	i = i + 1
end

p k