//
//
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define gc getchar_unlocked
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define pi(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#define ps(s) printf("%s\n", s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define deb3(x) cout < < < < x << endl
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define sz(a) int((a).size())
#define inp(arr, n)                                                                                                                                            \
    for (i = 0; i < n; i++)                                                                                                                                    \
        cin >> arr[i];
#define cum(arr, n, cumm)                                                                                                                                      \
    cumm[0] = 0;                                                                                                                                               \
    for (int i = 0; i < n; i++)                                                                                                                                \
        cumm[i + 1] = cumm[i] + arr[i];

#define fori(a, b, c) for (a = b; a <= c; a++)
#define ford(a, b, c) for (a = b; a >= c; a--)
#define fo(i, n) fori(i, 0, n)
#define rep1(i, n) fori(i, 1, n - 1)
#define disp(arr)                                                                                                                                              \
    for (auto i : arr)                                                                                                                                         \
        cout << i << " ";                                                                                                                                      \
    cout << "\n"
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define present(c, x) (c.find(x) != c.end())
#define cpresent(c, x) (find(all(c), x) != c.end())
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)

#define PI 3.1415926535897932384626
#define small 1e-9
#define big5 1000000005
#define big7 1000000007
#define big 1000000

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pll> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
const int mod = 1000000007;

bool isPrime(ll n) {
    if (n % 2 == 0)
        return false;
    for (ll i = 3; i <= sqrt(n); i += 2) {
        if (n % i == 0)
            return false;
    }
    return true;
}

ll SD(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n % i == 0)
            return i;
    }
    return n;
}

ll lcm(ll a, ll b) {
    return (a * b) / __gcd(a, b);
}

const int maxx = 200005;
vector<int> graph[maxx];

// Function to perform the DFS calculating the
// count of the elements in a connected component
void dfs(int curr, int& cnt, int* visited, vector<int>& duringdfs) {
    visited[curr] = 1;

    // Number of nodes in this component
    ++cnt;

    // Stores the nodes which belong
    // to current component
    duringdfs.push_back(curr);
    for (auto& child : graph[curr]) {
        // If the child is not visited
        if (visited[child] == 0) {
            dfs(child, cnt, visited, duringdfs);
        }
    }
}

// Function to return the desired
// count for every node in the graph
int MaximumVisit(int n, int k) {
    // To keep track of nodes we visit
    int visited[maxx];

    // Mark every node unvisited
    memset(visited, 0, sizeof(visited));
    int ans[maxx];

    // No of connected elements for each node
    memset(ans, 0, sizeof(ans));
    vector<int> duringdfs;
    for (int i = 1; i <= n; ++i) {
        duringdfs.clear();
        int cnt = 0;

        // If a node is not visited, perform a DFS as
        // this node belongs to a different component
        // which is not yet visited
        if (visited[i] == 0) {
            cnt = 0;
            dfs(i, cnt, visited, duringdfs);
        }

        // Now store the count of all the visited
        // nodes for any particular component.
        for (auto& x : duringdfs) {
            ans[x] = cnt;
        }
    }

    int result = ans[1];
    for (int i = 2; i <= n; ++i) {
        result = max(result, ans[i]);
    }
    return result;
}
void solve() {
    int n, i = 0, j = 0, k = 0, m;
    cin >> n >> m;
    fo(i, m - 1) {
        cin >> j >> k;
        graph[j].pb(k);
        graph[k].pb(j);
    }
    k = MaximumVisit(n, m);
    cout << k;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);


    ll t = 1;
    // cin >> t;

    while (t--) {
        solve();
    }


    return 0;
}

Measured memory_bytes: 29072