let n1 = readLine()!.split(separator: " ").map({$0})
    
    let n2 = readLine()!.split(separator: " ").map({$0})
    
    var r: Int = 0
    
    for i in 0 ..< n2.count {
      
      r += Int(n2[i])!
    }
    
    print(Int(n1[0])! - r)