"use strict";

const input = require("fs").readFileSync("/dev/stdin", "utf8");
const rows = input.trim().split("\n");

const header = rows.shift().split(" ").map(Number);
const N = header[0];
const K = header[1];

const map = {};
for (let i = 0; i < K; i += 2) {
  rows[i + 1].split(" ").forEach((n) => {
    map[n] = n;
  });
}

const result = N - Object.keys(map).length;
console.log(result);
