void main() {
  problem();
}

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

  long solve() {
    int[][int] friends;
    foreach(f; F) {
      if (!(f.a in friends)) friends[f.a] = [];
      if (!(f.b in friends)) friends[f.b] = [];
      friends[f.a] ~= f.b;
      friends[f.b] ~= f.a;
    }

    foreach(i; friends.keys) friends[i] = friends[i].uniq.array;
    
    bool[][] chainedFriend = N.iota.map!(x => new bool[N]).array;
    foreach(i; friends.keys) {
      foreach(j; friends[i]) {
        if (i == j) continue;

        chainedFriend[i][j] = true;
        foreach(k; friends[j]) {
          if (j == k) continue;
          chainedFriend[i][k] = true;
        }
      }
    }

    long ans = 1;
    foreach(i; 0..N) {
      long sumTrue;
      chainedFriend[i].each!(x => sumTrue += (x == true ? 1 : 0));
      if (ans < sumTrue) ans = sumTrue;
    }

    return ans;
  }

  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;

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