#include <algorithm>
#include <vector>
#include <cstdio>
#include <queue>
using namespace std;

#define pb push_back
#define mp make_pair
#define sc second
#define fs first

#define MAX 300005
#define DIM 100005

vector <pair <int,int> > vec,extra;
vector <pair <int,int> > g[DIM];
vector <int> cc[DIM];
int grd[DIM],newgrd[DIM];
bool viz[DIM],used[MAX];
int N,M,CC,sol;
queue <int> q;

void read ()
{
    int i,x,y;

    scanf ("%d%d",&N,&M);
    for (i=1; i<=M; ++i)
    {
        scanf ("%d%d",&x,&y);
        ++grd[x]; ++grd[y];
        g[x].pb (mp (y,i));
        g[y].pb (mp (x,i));
    }
}

void df (int nod,int ncc)
{
    vector <pair <int,int> > :: iterator it;

    viz[nod]=1; cc[ncc].pb (nod);
    for (it=g[nod].begin (); it!=g[nod].end (); ++it)
        if (!viz[it->fs])
            df (it->fs,ncc);
}

struct cmp_vec
{
    bool operator () (const pair <int,int> &a,const pair <int,int> &b)
    {
        return grd[a.fs]>grd[b.fs];
    }
};

inline void solve_bf (int ncc)
{
    vector <pair <int,int> > :: iterator it;
    vector <int> :: iterator it_s;
    int start,nod;

    start=0;
    for (it_s=cc[ncc].begin (); it_s!=cc[ncc].end (); ++it_s)
        if (grd[*it_s]>grd[start])
            start=*it_s;

    viz[start]=0;
    for (q.push (start); !q.empty (); q.pop ())
    {
        nod=q.front (); vec.clear (); extra.clear ();

        for (it=g[nod].begin (); it!=g[nod].end (); ++it)
            if (viz[it->fs])
                vec.pb (*it);
            else if (!used[it->sc])
                extra.pb (*it);

        sort (vec.begin (),vec.end (),cmp_vec ());
        for (it=vec.begin (); it!=vec.end (); ++it)
        {
            q.push (it->fs);
            used[it->sc]=1;
            viz[it->fs]=0;

            ++newgrd[it->fs];
            --grd[it->fs];
        }

        for (it=extra.begin (); it!=extra.end (); ++it)
        {
            if (newgrd[nod]<newgrd[it->fs])
                ++newgrd[nod];
            else
                ++newgrd[it->fs];

            used[it->sc]=1;
        }
    }
}

void solve ()
{
    vector <int> :: iterator it;
    int i;

    for (i=1; i<=N; ++i)
        if (!viz[i])
            df (i,++CC);

    for (i=1; i<=CC; ++i)
        solve_bf (i);

    for (i=1; i<=N; ++i)
        sol=max (sol,newgrd[i]);
	printf ("%d",sol);
}

int main ()
{
    freopen ("dag.in","r",stdin);
    freopen ("dag.out","w",stdout);

    read ();
    solve ();

    return 0;
}
