fun main(args: Array<String>) {
    var tmpLine = readLine()
    var tmps = tmpLine!!.split("\\s+".toRegex())

    for (i in 0..4) {
        val tmpx = tmps[i]
        if (tmpx.toInt() == 0) {
            println("${i+1}")
        }
    }
}