function MainC(input){
    const arr = input.split('\n');
    const [[N, M] , ...AB] = arr.map(a => a.split(' ').map(Number));
    let checkSet = new Set();
    let answer = 0;
    checkSet.add(AB[0][0]);
    checkSet.add(AB[0][1]);
    for(let i=1; i<AB.length; i++){
        if(!(checkSet.has(AB[i][0]) || checkSet.has(AB[i][1]))){
            answer++;
        }
        checkSet.add(AB[i][0]);
        checkSet.add(AB[i][1]);
    }
    for(let i=1; i<=N; i++){
        if(!checkSet.has(i)){
            answer++;
        }
    }
    console.log(answer);
}
MainC(require("fs").readFileSync("/dev/stdin", "utf8").trim());
