import Foundation

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

func main(){
    let ints = readInts()
    var count = 1
    
    for int in ints{
        if int != count {
            print(count)
            return
        }
        count += 1
    }
}

main()
