class UnionFind
  attr_reader :id, :sz

  # @param {Integer} n
  def initialize(n)
    @id = Array.new(n)
    @sz = Array.new(n)
    n.times do |i|
      @id[i] = i
      @sz[i] = 1
    end
  end

  def connected?(i, j)
    root(i) == root(j)
  end

  def unite(i, j)
    iroot = root(i)
    jroot = root(j)
    return if iroot == jroot
    if @sz[iroot] < @sz[jroot]
      @id[iroot] = j
      @sz[jroot] += @sz[iroot]
    else
      @id[jroot] = i
      @sz[iroot] += @sz[jroot]
    end
  end

  private

  def root(i)
    if @id[i] == i
      i
    else
      @id[i] = @id[@id[i]] # pass compression
      root(@id[i])
    end
  end
end


n,m = gets.split.map(&:to_i)

uf = UnionFind.new(n)

m.times do |i|
  a,b = gets.split.map(&:to_i)
  uf.unite(a-1,b-1)
end

puts uf.sz.max
