import Data.List
import Control.Monad

getList :: IO [Int]
getList = do
    _ <- readLn :: IO Int
    ak <- map read <$> (words <$> getLine) :: IO [Int]
    return ak


main = do
    [n,k] <- map read <$> (words <$> getLine) :: IO [Int]
    giveList <- replicateM k getList
    let ls = nub $ concat $ giveList
    print $ length $ filter (not . flip elem ls) [1..n] 
