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 |leader|
  next if groups[leader]

  queue = [leader]

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

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

      queue << friend
    end

    groups[current] = leader
  end
end

puts groups.tally.values.max
