import qualified Data.Set as ST
import Control.Monad

main = do
    [n,k] <- map read . words <$> getLine :: IO [Int]
    xs <- ST.fromList . concat <$> (replicateM k $ getLine >> getLine >>= return . map read . words) :: IO (ST.Set Int)
    print $ n - ST.size xs