#include #pragma GCC optimize("Ofast") using namespace std; using std::cout; using std::cin; using std::endl; using ll=long long; using ld=long double; ll ILL=2167167167167167167; const int INF=2100000000; const ll mod=998244353; #define rep(i,a) for (ll i=0;i using _pq = priority_queue, greater>; template ll LB(vector &v,T a){return lower_bound(v.begin(),v.end(),a)-v.begin();} template ll UB(vector &v,T a){return upper_bound(v.begin(),v.end(),a)-v.begin();} template bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}else return 0;} template bool chmax(T &a,const T &b){if(a void So(vector &v) {sort(v.begin(),v.end());} template void Sore(vector &v) {sort(v.begin(),v.end(),[](T x,T y){return x>y;});} void yneos(bool a){if(a) cout<<"Yes\n"; else cout<<"No\n";} template void vec_out(vector &p){for(int i=0;i<(int)(p.size());i++){if(i) cout<<" ";cout< T min(vector &a){assert(!a.empty());T ans=a[0];for(auto &x:a) chmin(ans,x);return ans;} template T max(vector &a){assert(!a.empty());T ans=a[0];for(auto &x:a) chmax(ans,x);return ans;} namespace po167{ struct UFtree { using _F=int; int _n; std::vector<_F> wei; std::vector q; int component; UFtree(int n):_n(n),wei(n),component(n),par(n){ for(int i=0;i par; }; } using po167::UFtree; void solve(); // oddloop int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t=1; //cin>>t; rep(i,t) solve(); } void solve(){ int N,M; cin>>N>>M; int ans=0; UFtree T(N); vector A(M),B(M); rep(i,M){ cin>>A[i]>>B[i]; A[i]--,B[i]--; } reverse(all(A)); reverse(all(B)); rep(i,M){ if(T.same(A[i],B[i])){ int a=T.root(A[i]); T.wei[a]++; chmax(ans,T.wei[a]); }else{ int a=T.root(A[i]); int b=T.root(B[i]); T.wei[a]++; T.wei[b]++; T.unite(a,b); chmax(ans,T.wei[T.root(a)]); } } cout<