func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let xs: [Int] = readInts()
    var i = 0
    for x in xs {
        i += 1
        if x == 0 {
            print(i)
        }
    }
}

main()
