/* -*- coding: utf-8 -*- * * 2052.cc: No.2052 Indegree - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 100; /* typedef */ /* global variables */ int ids[MAX_N]; /* subroutines */ /* main */ int main() { int n, m; scanf("%d%d", &n, &m); for (int i = 0; i < m; i++) { int u, v; scanf("%d%d", &u, &v); u--, v--; ids[v]++; } int c = 0; for (int i = 0; i < n; i++) if (ids[i] == 0) c++; printf("%d\n", c); return 0; }