class UnionFind
  def initialize(n)
    @data = Array.new(n,&:itself)
  end
  def root(i)
    _compact!(i, _root(i))
  end
  def same?(i,j)
    root(i) == root(j)
  end
  def unite!(i,j)
    _compact!(i, root(j))
  end
  def _root(i)
    i = @data[i] until i == @data[i]
    return i
  end
  def _compact!(i,r)
    until @data[i] == r
      tmp = @data[i]
      @data[i] = r
      i = tmp
    end
    return r
  end
end
N, M = gets.split.map(&:to_i)
uf = UnionFind.new(N + 1)
M.times do
  a,b = gets.split.map(&:to_i)
  uf.unite!(a,b)
end
G = (1 .. N).group_by{|i| uf.root(i) }
puts G.transform_values(&:size).values.max
