class UnionFind
  def initialize(n)
    @n = n
    @par = Array.new(@n).map.with_index{|x, i| i}
    @chl = Array.new(@n).map{[]}
  end
  def union(a, b)
    pa, pb = [@par[a], @par[b]]
    if pa < pb then
      absorb(a, b)
    elsif pa > pb then
      absorb(b, a)
    end
  end
  def max_size
    @chl.compact.map{|x| x.size}.max
  end
  
  private
  
  def absorb(pa, ch)
    par = @par[pa]
    chl = @par[ch]
    @chl[chl].each{|c|
      @chl[par] << c
      @par[c] = par
    }
    @chl[chl] = nil
    @chl[par] << chl
    @par[chl] = par
  end
end

N, M = gets.chomp.split(" ").map(&:to_i)
R = (0...M).map{gets.chomp.split(" ").map(&:to_i)}

uf = UnionFind.new(N+1)
R.each{|a, b| uf.union(a, b)}

puts uf.max_size+1
