function main(input) {
  const lines = input.trim().split("\n");
  const [N, K] = lines[0].split(' ').map(Number);

  const a = new Set();
  const limit = K * 2;
  for (let i = 2; i <= limit; i += 2) {
    const as = lines[i].split(' ').map(Number);
    as.forEach(_a => a.add(_a) );
  }
  const res = N - a.size;
  
  console.log(res);
}

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