fun main(){ println(readLine()!!.let{ when(it.length){ 2 -> 1 else -> it.length - 1 - it.substring(1..it.length-1).count({it=='0'}) } }) }