import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val s = sc.next()

  println(agc037a(s))
}

private fun agc037a(s: String): Int {
  var ans = 1
  var pre = s.get(0).toString()
  var now = ""
  for (i in 1 until s.length) {
    now += s.get(i)
    if (now != pre) {
      ans++
      pre = now
      now = ""
    }
  }

  return ans
}
