#include #include using namespace atcoder; using namespace std; #define int long long signed main(){ int N,M; cin>>N>>M; vector> S(M); dsu uf(2*N); for(int i=0;i>a>>b; a--; b--; uf.merge(a,b); } int ans = N; for(int i=0;i<2*N;i++)if(uf.leader(i) == i) ans -= uf.size(i)/2; cout<