object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val x :: xs = sc.next().toCharArray.toList
  val ((_, count), _) = xs.foldLeft(x -> 1 -> false) {
    case (((before, count), shouldSplit), char) =>
      if (shouldSplit) '0' -> (count + 1) -> false
      else if (char == before) char -> count -> true
      else char -> (count + 1) -> false
  }
  println(count)
}
