#include using namespace std; int main(void) { int n,m; cin >> n >> m; vector u(m); vector v(m); vector outdeg(n); vector indeg(n); for(int i=0;i> u[i] >> v[i]; --u[i]; --v[i]; ++outdeg[u[i]]; ++indeg[v[i]]; } int ans=0; for(int i=0;i0){ --ans; } cout << ans << endl; return 0; }