N, M = gets.split.map(&:to_i)

groups = Hash.new()
belongs = [nil]*N

group = 0
M.times {
  a, b = gets.split.map(&:to_i)
  belong = belongs[a] != nil ? belongs[a] : belongs[b] != nil ? belongs[b] : group

  belongs[a] = belong
  belongs[b] = belong

  if groups[belong] == nil then
    groups[belong] = [a, b]
  else
    groups[belong].push(a, b)
  end
  group += 1
}

p groups.values.map{|list| list.uniq.size }.max
