class UnionFind
  def initialize(n)
    @tree = Array.new(n, -1)
  end
  def find(x)
    @tree[x] < 0 ? x : @tree[x] = find(@tree[x])
  end
  def unite(x,y)
    x,y = find(x),find(y)
    if x != y
      x,y = y,x if @tree[x] > @tree[y]
      @tree[x] += @tree[y]
      @tree[y] = x
    end
  end
  def size(x)
    -@tree[find(x)]
  end
  def parents
    @tree.map.with_index {|n,i| n < 0 ? i : n }
  end
end

N,M = gets.split.map(&:to_i)
AB = readlines.map {|s| s.split.map(&:to_i) }

uf = UnionFind.new(N)
AB.each {|a,b| uf.unite(a-1,b-1) }
puts uf.parents.uniq.map {|n| uf.size(n) }.max
