object Main {
  def main(args: Array[String]) = {

    val sc = new java.util.Scanner(System.in)
    val s = sc.next
    sc.close()

    if (s.length == 1) {
      println(s.length)
    } else {
      val ks = calc(s.drop(1), List(s.head.toString))
      println(ks.length)
    }

    def calc(xs: String, k: List[String]): List[String] = xs.isEmpty match {
      case true => k
      case _ => {
        if (k.head == xs.head.toString) {
          if (xs.length == 1) {
            calc("", k)
          } else {
            calc(xs.drop(2), xs.take(2) :: k)
          }
        } else
          calc(xs.drop(1), xs.take(1) :: k)
      }
    }
  }
}