
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
		}
	}

	var rf = true
	var lf = true
	var r = 0
	var l = 0

	for(i<-temp){
		if(i == 0){
			if(rf) r = r + 1
			else r = 1
		}else{
			if(lf) l = l + 1
			else l = 1
		}
	}

	if(l>r) println(l)
		else println(r)

}