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

tree = []
root_child = {}
(1..n).each do |x|
  tree.push(-1)
  root_child[x - 1] = []
end

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)
  next if a_root == b_root

  root_child[a_root].push(b_root)
  root_child[b_root].each do |child|
    root_child[a_root].push(child) unless root_child[a_root].include?(child)
    tree[child] = a_root
  end
  tree[b_root] = a_root
  root_child[b_root] = []
end

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

puts max
