class Main
  def execute
    @s = 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
    puts @count
  end
end
Main.new.execute