n,m = gets.chomp.split.map(&:to_i)
ab = []
m.times do |i|
  a,b = gets.chomp.split.map(&:to_i)
  if a > b
    a,b=b,a
  end
  ab.push([a,b])
end
ab.uniq!

class UnionFind
  def initialize(size)
    @rank = Array.new(size, 0)
    @parent = Array.new(size, &:itself)
  end

  def unite(id_x, id_y)
    x_parent = get_parent(id_x)
    y_parent = get_parent(id_y)
    return if x_parent == y_parent

    if @rank[x_parent] > @rank[y_parent]
      @parent[y_parent] = x_parent
    else
      @parent[x_parent] = y_parent
      @rank[y_parent] += 1 if @rank[x_parent] == @rank[y_parent]
    end
  end

  def get_parent(id_x)
    @parent[id_x] == id_x ? id_x : (@parent[id_x] = get_parent(@parent[id_x]))
  end

  def same_parent?(id_x, id_y)
    get_parent(id_x) == get_parent(id_y)
  end
end

union = UnionFind.new(n)
ab.each do |t|
  a,b=t
  a-=1
  b-=1
  union.unite(a,b)
end
group = []
n.times do |i|
  group.push(union.get_parent(i))
end
t =group.tally
cou = t.map{|k,v|v}
p cou.max
