s = gets.chomp
ln = s.length
s = s.split("")
id = 0
cnt = 0
pre = Array.new(2)
while id < ln
  if id > 0
    if pre.join.length >= 2
      pre[0] = s[id]
      pre[1] = nil
      cnt += 1
      id += 1
    else
      if pre[0] == s[id]
        if id+1 < ln
          pre[0] = s[id]
          pre[1] = s[id+1]
          cnt += 1
          id += 2
        else
          pre[0] = s[id]
          id += 1
        end
      else
        pre[0] = s[id]
        pre[1] = nil
        cnt += 1
        id += 1
      end
    end
  else
    pre[0] = s[id]
    pre[1] = nil
    cnt += 1
    id += 1
  end
end
puts cnt
