#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int N=10005;
int n,m;
vector <int> G[N];
vector <int> L;
int Cnt[N];
int label[N];
int Q[N];
int F[N];
int main(){
scanf("%d%d",&n,&m);
for (int i=1;i<=n;i++) G[i].clear();
for (int i=0;i<m;i++){
int x,y;
scanf("%d%d",&x,&y);
G[x].push_back(y);
G[y].push_back(x);
}
for (int i=1;i<=n;i++) Cnt[i]=label[i]=0;
for (int i=n;i>=1;i--){
int Max=-1;
int Maxi=-1;
for (int j=1;j<=n;j++)
if (label[j]==0 && Cnt[j]>Max){
Max=Cnt[j];
Maxi=j;
}
label[Maxi]=i;
Q[i]=Maxi;
for (vector<int>::iterator it=G[Maxi].begin();it!=G[Maxi].end();it++)
if (label[*it]==0) Cnt[*it]++;
}
int ans=1;
for (int k=n;k>=1;k--){
int i=Q[k];
F[i]=1;
L.clear();
for (vector<int>::iterator it=G[i].begin();it!=G[i].end();it++)
if (label[*it]>label[i]) F[i]++;
ans=max(ans,F[i]);
}
printf("%d\n",ans);
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGNzdHJpbmc+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPHZlY3Rvcj4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IGludCBOPTEwMDA1OwppbnQgbixtOwp2ZWN0b3IgPGludD4gR1tOXTsKdmVjdG9yIDxpbnQ+IEw7CmludCBDbnRbTl07CmludCBsYWJlbFtOXTsKaW50IFFbTl07CmludCBGW05dOwoKaW50IG1haW4oKXsKCXNjYW5mKCIlZCVkIiwmbiwmbSk7Cglmb3IgKGludCBpPTE7aTw9bjtpKyspIEdbaV0uY2xlYXIoKTsKCWZvciAoaW50IGk9MDtpPG07aSsrKXsKCQlpbnQgeCx5OwoJCXNjYW5mKCIlZCVkIiwmeCwmeSk7CgkJR1t4XS5wdXNoX2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