program main
  implicit none
  integer :: n, i, cnt = 1
  character(200000) :: s
  logical :: skip = .false.

  read *, s
  n = len_trim(s)

  do i = 2, n
    if (skip) then
      skip = .false.
      cycle
    end if
    cnt = cnt + 1
    if (s(i:i) == s(i-1:i-1)) then
      skip = .true.
    end if
  end do
  print '(i0)', cnt
end program