n,m = gets.split.map(&:to_i)
groups = {}
h = {}
m.times do
  a, b = gets.split.map(&:to_i)
  a, b = [a, b].sort
  group = h[a] || h[b]
  if group
    h[a] = group
    h[b] = group
    groups[group] << a
    groups[group] << b
  else
    h[a] = a
    h[b] = a
    groups[a] = [a, b]
  end
end

groups.keys.each do |k|
  groups[k].uniq!
end

ans = -Float::INFINITY

groups.keys.each do |k|
  ans = [ans, groups[k].size].max
end

puts ans