require 'set'

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

v = (0...n).map { nil }
g = (0...n).map { Set.new }
m.times do
  a, b = gets.chomp.split(' ').map(&:to_i)
  a -= 1
  b -= 1
  g[a].add(b)
  g[b].add(a)
end

(0...n).each do |i|
  next if v[i]

  c = 1

  s = [i]
  v[i] = c
  while !(s.empty?)
    j = s.pop
    g[j].each do |k|
      next if v[k]
      s.push(k)
      c += 1
      v[k] = c
    end
  end
end

puts v.max
