'use strict';
function main(input) {
  const
    arr = input.trim().split('\n'),
    [n, k] = arr[0].split(' ').map(x => Number(x));
  let
    ans = [];
  
  for (let i = 2; i <= k * 2; i += 2) {
    ans.push(input[i].split(' ').map(x => Number(x)));
  }

  const a = ans.filter(function (x, i, self) {
    return self.indexOf(x) === i;
});
  
  console.log(n - a.length);
}

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