import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.IntSet as IS

main :: IO ()
main = do
  [n, k] <- f
  solve n <$> replicateM k (getLine >> f) >>= print
  where
    f = map read <$> words <$> getLine

solve :: Int -> [[Int]] -> Int
solve n = (n -) . IS.size . foldl' (foldl' (flip IS.insert)) IS.empty 
