input = readlines()
n, m = input.shift.chomp.split("\s").map{|x| x.to_i}

tree = Array.new(n, -1)
root_child = {}
child_root = {}

def getRoot(tree, target)
  while(tree[target] > -1)
    target = tree[target]
  end

  target
end

input.each do |l|
  a, b = l.chomp.split("\s").map{|x| x.to_i - 1}
  # a_root = getRoot(tree, a)
  # b_root = getRoot(tree, b)
  a_root = child_root[a].nil? ? a : child_root[a]
  b_root = child_root[b].nil? ? b : child_root[b]
  next if a_root == b_root

  root_child[a_root] = [] if root_child[a_root].nil?
  root_child[a_root].push(b_root)
  root_child[b_root].to_a.each do |child|
    root_child[a_root].push(child) unless root_child[a_root].include?(child)
    # tree[child] = a_root
    child_root[child] = a_root
  end
  # tree[b_root] = a_root
  child_root[b_root] = a_root
  root_child[b_root] = nil
end

max = 0
root_child.each do |k, vlist|
  next if vlist.nil?
  cnt = vlist.length + 1
  max = cnt if max < cnt
end

puts max
