class UnionFind
  attr_accessor :sizes
  attr_accessor :par

  def initialize(n)
      @par = Array.new(n){ |i| i }
      @sizes = Array.new(n, 1)
  end

  def root(x)
      return x if par[x] == x
      par[x] = root(par[x])
  end

  def unite(x, y)
      rx = root(x)
      ry = root(y)
      unless rx == ry then
        par[rx] = ry
        t = sizes[rx] + sizes[ry]
        sizes[ry] = t
        return t
      end
      0
  end

  def same(x, y)
      rx = root(x)
      ry = root(y)
      rx == ry
  end
end

N, M = gets.split.map(&:to_i)
uf = UnionFind.new(N + 1)

m = 0
M.times do |i|
  pair = gets.split.map(&:to_i)
  t = uf.unite(pair[0],pair[1])
  m = t if t > m
end

puts m
