class A {
    static func solve() {
        let xs = readLine()!.split(separator: " ")
        if xs[0] != "1" {
            print("1")
        } else if xs[1] != "2" {
            print("2")
        } else if xs[2] != "3" {
            print("3")
        } else if xs[3] != "4" {
            print("4")
        } else if xs[4] != "5" {
            print("5")
        }
    }
}

A.solve()
