function Main(input) {
  input = input.split("\n");
  const NK = input[0].split(" ");
  const N = parseInt(NK[0], 10);
  const K = parseInt(NK[1], 10);
  var d = [];
  var A = [];
for(var i=1;i<=2*K;i+=2){
    d = d.concat(parseInt(input[i],10));
    var Ai = input[i+1].split(" ").map(n=>parseInt(n,10))
    A = A.concat(Ai)
}
console.log(A,d);

  var newA = A.filter((v,i)=>{
      return A.indexOf(v) == i
  })
  console.log(N - newA.length)

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
