import Control.Monad
import Data.Set hiding (map)

main :: IO ()
main = do
  l1 <- getLine
  let [n, k] = map read $ words l1 :: [Int]
  lk <- replicateM k $ getLine *> getLine
  let ak = map (map read . words) lk :: [[Int]]
      holder = unions $ map fromList ak

  print $ n - size holder
