
object Main extends App {
	val temp = scala.io.StdIn.readLine.toArray.map(_.toInt - 48)

	for(i<-0 until temp.size - 1){
		if(temp(i) < temp(i+1)){
			temp(i) = 1
			temp(i+1) = 0
		}
	}

	if(temp.size-temp.sum > temp.sum) println(temp.size - temp.sum)
	else println(temp.sum)

}