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

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

group = 0
M.times {
  a, b = gets.split.map(&:to_i)
  a_belong, b_belong = [belongs[a], belongs[b]]

  if a_belong != nil and b_belong != nil and a_belong != b_belong then
    groups[a_belong] = groups[a_belong] + groups[b_belong]
    groups[b_belong].each { |i|
      belongs[i] = a_belong
    }
  else
    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
  end

  group += 1
}

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