const main = input => parseInt(input.split(" ")[0]) - new Set(input.split("\n").slice(1).filter((e, i) => i % 2).map(e => e.split(" ")).flat()).size; // Implement this function
 
console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8'))); // Common part