using static System.Math; using System.Collections.Generic; using System.Linq; using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var m = int.Parse(line[1]); getAns(n,m); } static void getAns(int n, int m) { var from = new bool[n]; for (int i = 0; i < m; i++) { string[] line = Console.ReadLine().Trim().Split(' '); var w = int.Parse(line[1]) - 1; from[w] = true; } var ans = from.Count(x => x == false); Console.WriteLine(ans); } }