require "set"
N, M = gets.split.map(&:to_i)
ABs = M.times.map { gets.split.map(&:to_i) }

# $stdout = File.open(File::NULL, "w")

def main
  map = {}
  ABs.each do |ab|
    a, b = ab
    am = map[a] || Set[a]
    bm = map[b] || Set[b]
    next if am == bm
    newm = am + bm
    map[a] = newm
    map[b] = newm
  end
  return map.values.uniq.map(&:length).max
end

STDOUT.puts main
