class UnionFind
  attr_accessor :arr

  def initialize(size)
    @arr = Array.new(size, -1)
  end

  def unite(a, b)
    pa, pb = [parent(a), parent(b)].sort
    return if pa == pb
    @arr[pb] = pa
  end

  def parent(x)
    return x if @arr[x] == -1
    @arr[x] = parent(@arr[x])
  end

  def same(a, b)
    self.parent(a) == self.parent(b)
  end
end

n, m = gets.chomp.split(' ').map(&:to_i)
uf = UnionFind.new(n + 1)
m.times do
  a, b = gets.chomp.split(' ').map(&:to_i)
  uf.unite(a, b)
end
map = Hash.new(0)
(1..n).each do |i|
  map[uf.parent(i)] += 1
end
puts map.values.max
