n, m = gets.split.map(&:to_i)
relations = []
m.times do
  relations << gets.split.map(&:to_i)
end

graph = Array.new(n) { [] }
relations.each do |a, b|
  graph[a - 1] << b - 1
  graph[b - 1] << a - 1
end

groups = []

0.upto(n - 1) do |target|
  next if groups[target]

  queue = [target]
  leader = target

  until queue.empty?
    current = queue.shift
    next if groups[current]

    graph[current].each do |friend|
      next if groups[friend]

      groups[friend] = leader
      queue << friend
    end
  end

  groups[target] = target
end

puts groups.tally.values.max
