#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N >> L; vector indeg(N,0); rep(i, 0, L){ int A, B; cin >> A >> B; A--, B--; indeg[B]++; } int ans = 0; rep(i, 0, N){ if(!indeg[i]) ans++; } cout << ans << endl; return 0; }