import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] c = new int[n]; for (int i = 0; i < m; i++) { sc.nextInt(); int b = sc.nextInt() - 1; c[b]++; } sc.close(); int ans = 0; for (int i = 0; i < c.length; i++) { if (c[i] == 0) { ans++; } } System.out.println(ans); } }