# 1 "d.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "d.cpp"
# 1 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 1
       
# 11 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/bits/stdc++.h" 1
 #include<bits/stdc++.h>
# 12 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/ext/pb_ds/assoc_container.hpp" 1
 #include<ext/pb_ds/assoc_container.hpp>
# 13 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/ext/pb_ds/tree_policy.hpp" 1
 #include<ext/pb_ds/tree_policy.hpp>
# 14 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 23 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
using namespace std;
using namespace __gnu_pbds;

using ii = pair<int64_t, int64_t>;
using tt = tuple<int64_t, int64_t, int64_t>;

using vi = vector<int64_t>;
using vd = vector<double>;
using vb = vector<bool>;
using vii = vector<ii>;
using vtt = vector<tt>;

using vvi = vector<vi>;
using vvd = vector<vd>;
using vvb = vector<vb>;
using vvii = vector<vii>;
using vvtt = vector<vtt>;
# 60 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
template<typename T>
ostream &operator<<(ostream &lhs, const vector<T> &rhs)
{
    if(is_floating_point<T>::value)
        lhs << fixed << setprecision(10);
    for(size_t i = 0; i < rhs.size(); ++i) {
        if(i)
            lhs << ' ';
        lhs << rhs[i];
    }
    return lhs;
}

template<typename T, size_t N>
ostream &operator<<(ostream &lhs, const array<T, N> &rhs)
{
    if(is_floating_point<T>::value)
        lhs << fixed << setprecision(10);
    for(size_t i = 0; i < rhs.size(); ++i) {
        if(i)
            lhs << ' ';
        lhs << rhs[i];
    }
    return lhs;
}
# 2 "d.cpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../include/cpplib/adt/dsu.hpp" 1
       


/**
 * Disjoint Set Union.
 *
 * Tracks a set of elements partitioned
 * into a number of disjoint subsets.
 *
 * Time Complexity: O(n + m*log(n)).
 * Space Complexity: O(n).
 * Where n is the number of elements and m is the number of links between them.
 */
class DSU
{
public:
    DSU(const int64_t set_size) :
        root(set_size), sz(set_size, 1), set_size(set_size)
    {
        iota(root.begin(), root.end(), 0);
    }

    DSU(const int64_t set_size, const vector<pair<int64_t, int64_t> > &links) :
        DSU(set_size)
    {
        for(const auto &l: links)
            merge(l.first, l.second);
    }

    /**
     * Finds the element that represents
     * the set containing x.
     *
     * Time Complexity: O(log(n)).
     * Space Complexity: O(1).
     * Where n is the number of tracked elements.
     */
    int64_t find(const int64_t x)
    {
        assert(0 <= x and x < set_size);
        return root[x] == x ? x : root[x] = find(root[x]);
    }

    /**
     * Merges the sets containing a and b.
     *
     * Time Complexity: O(log(n)).
     * Space Complexity: O(1).
     * Where n is the number of tracked elements.
     */
    bool merge(int64_t a, int64_t b)
    {
        assert(0 <= a and a < set_size);
        assert(0 <= b and b < set_size);
        a = find(a);
        b = find(b);

        if(a == b)
            return false;

        if(sz[a] < sz[b])
            swap(a, b);

        root[b] = a;
        sz[a] += sz[b];
        return true;
    }

    /**
     * Checks if two elements are in the same set.
     *
     * Time Complexity: O(log(n)).
     * Space Complexity: O(1).
     * Where n is the number of tracked elements.
     */
    bool same(const int64_t a, const int64_t b)
    {
        assert(0 <= a and a < set_size);
        assert(0 <= b and b < set_size);
        return find(a) == find(b);
    }

    /**
     * Returns the size of the set containing x.
     *
     * Time Complexity: O(log(n)).
     * Space Complexity: O(1).
     * Where n is the number of tracked elements.
     */
    int64_t size(const int64_t x)
    {
        assert(0 <= x and x < set_size);
        return sz[find(x)];
    }

private:
    vector<int64_t> root, sz;
    int64_t set_size;
};
# 3 "d.cpp" 2

int32_t main(){
    (ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL));
    int64_t n, m;
    cin >> n >> m;

    DSU dsu(n);

    for(int64_t i=0; i<m; ++i){
        int64_t u, v;
        cin >> u >> v;
        u--;
        v--;
        dsu.merge(u, v);
    }

    set<int64_t> ans;
    for(int64_t i=0; i<n; ++i)
        ans.emplace(-dsu.size(i));
    cout << -(*ans.begin()) << "\n";
    return 0;
}


Measured memory_bytes: 6380