import           Control.Monad
import qualified Data.IntSet   as S

readInts :: IO [Int]
readInts = map read . words <$> getLine

main :: IO ()
main = do
  [n, k] <- readInts
  sets <- replicateM k (getLine >> S.fromList <$> readInts)
  print $ solve n sets

solve :: Int -> [S.IntSet] -> Int
solve n sets = S.size $ foldl (S.\\) (S.fromList [1..n]) sets
