import kotlin.system.exitProcess

fun main(args: Array<String>) {
    val xList = readLine()!!.split(" ").toList()
    for ((index, x) in xList.withIndex()) {
        if (x == "0") {
            println(index + 1)
            exitProcess(0)
        }
    }
}