class Main
  def execute
    File.open(Dir::pwd + "/input", "r") do |io|
      @s = io.gets.chars
      @p = ""
      @h = ""
      @count = 0
      @s.each do |w|
        @h += w
        if @p == @h
          @p = @h
        else
          @p = @h
          @h = ""
          @count += 1
        end
      end
    end
    puts @count
  end
end
Main.new.execute