void main() {
  problem();
}

void problem() {
  auto N = scan!int;
  auto M = scan!int;
  auto F = M.iota.map!(x => Pair(scan!int, scan!int)).array;

  long solve() {
    int[][] friends;
    int[int] friendsIndex;
    foreach(f; F) {
      auto aIndex = f.a in friendsIndex;
      auto bIndex = f.b in friendsIndex;

      if (aIndex == null && bIndex == null) {
        friends ~= [ f.a, f.b ];
        auto l = cast(int)friends.length - 1;
        friendsIndex[f.a] = l; 
        friendsIndex[f.b] = l; 
      } else if (aIndex == null) {
        friends[*bIndex] ~= f.a;
        friendsIndex[f.a] = *bIndex; 
      } else if (bIndex == null) {
        friends[*aIndex] ~= f.b;
        friendsIndex[f.b] = *aIndex; 
      } else if (*aIndex != *bIndex) {
        friends[*aIndex] = join([friends[*aIndex], friends[*bIndex]]);
        friends[*bIndex] = [];
        friendsIndex[f.b] = *aIndex;
      }
    }

    friends.deb;
    friendsIndex.deb;

    long groupSize = 1;
    foreach(i; 0..friends.length) {
      auto f = friends[i];
      if (f.length > groupSize) groupSize = f.length;
    } 

    return groupSize;
  }

  solve().writeln;
}

// ----------------------------------------------

import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons, std.numeric;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; }
T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
void deb(T ...)(T t){ debug writeln(t); }
alias Point = Tuple!(long, "x", long, "y");
alias Pair = Tuple!(int, "a", int, "b");
const MOD = 7 + 10^^9;

// -----------------------------------------------
