class UnionFind
  attr_accessor :parent

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

  def root(x)
      if @parent[x] < 0
          x
      else
          @parent[x] = root(@parent[x])
      end
  end

  def same_parent?(x, y)
      root(x) == root(y)
  end

  def merge(x, y)
      x_root = root(x)
      y_root = root(y)

      return false if x_root == y_root

      if @parent[x_root] > @parent[y_root]
          x_root, y_root = y_root, x_root
      end

      @parent[x_root] += @parent[y_root]
      @parent[y_root] = x_root

      return true
  end

  def size(x)
      return -@parent[root(x)]
  end
end

N, M = gets.split.map(&:to_i)
uf = UnionFind.new(N + 1)

m = 0
M.times do |i|
  pair = gets.split.map(&:to_i)
  t = uf.merge(pair[0],pair[1])
end

N.times do |i|
  a = uf.size(i + 1)
  m = a if m < a
end

puts m
