import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

main = abc163b

abc163b = do
    [n, _] <- getIntList
    as <- getIntList
    print $ n - sum as

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine