n,m = gets.chomp.split(" ").map(&:to_i)
ab_arr = m.times.map{gets.chomp.split(" ").map(&:to_i)}

class UnionFind
  attr_accessor :rank, :parent, :union_size
  def initialize(size)
    @rank = Array.new(size, 0)
    @parent = Array.new(size, &:itself)
    @union_size = Array.new(size, 1)
  end
 
  def unite(x, y)
    x_parent = get_parent(x)
    y_parent = get_parent(y)
    return if x_parent == y_parent
 
    if @rank[x_parent] > @rank[y_parent]
      @parent[y_parent] = x_parent
      @union_size[x_parent] += @union_size[y_parent]
    else
      @parent[x_parent] = y_parent
      @union_size[y_parent] += @union_size[x_parent]
      @rank[y_parent] += 1 if @rank[x_parent] == @rank[y_parent]
    end
  end
 
  def get_parent(x)
    @parent[x] == x ? x : (@parent[x] = get_parent(@parent[x]))
  end
end

uf = UnionFind.new(n)
ab_arr.each do |(a, b)|
  uf.unite(a-1, b-1)
end
puts uf.union_size.max


