process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var nk = lines[0].split(' ');
 var n = Number(nk[0]);
 var k = Number(nk[1]);
 var ans = new Set();
 for(i=2;i<=k*2;i+=2){
   var a = lines[i].split(' ');
   if(a.length != 1){
     for(i=0; i<a.length; i++){
        ans.add(a[i]);
     }
   }else{
   a = a.join('');
   ans.add(a);
 }
 }
 console.log(n - ans.size);
});