#include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N, M, A, B, i, ans = 0; cin >> N >> M; vector count(N, 0); for (i = 0; i != M; ++i) cin >> A >> B, ++count[B - 1]; for (i = 0; i != N; ++i) if (count[i] == 0) ++ans; cout << ans << '\n'; return 0; }