#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { ll n, m, cnt; cin >> n >> m; vector g(n+1); for (int i = 0; i < m; i++){ int out, in; cin >> out >> in; g[in]++; } for (int i = 1; i < n + 1; i++){ if(g[i] == 0) cnt++; } cout << cnt << endl; }