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

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

    if (s.distinct.length == 1) {
      println(1)
    } else {
      val ans = calc(s.drop(1), s.head, 0)
      println(ans)
    }

    def calc(xs: String, k: Char, count: Int): Int = xs.isEmpty match {
      case true => count + 1
      case _ => {
        if (k == ' ') {
          calc(xs.drop(1), xs.head, count)
        } else if (xs.head == k) {
          calc(xs.drop(1), ' ', count + 1)
        } else {
          calc(xs.drop(1), xs.head, count + 1)
        }
      }
    }
  }
}