import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List ((\\))

main :: IO ()
main = do
  [n, k] <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  ass <- sequence . replicate k $ T.getLine >> (map unsafeTextToInt . T.words <$> T.getLine) :: IO [[Int]]
  print . length $ [1..n] \\ concat ass

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
