require 'set'
n,m = gets.split.map(&:to_i)
groups = {}
h = {}
m.times do
  a, b = gets.split.map(&:to_i)
  a, b = [a, b].sort

  if g = h[a] || h[b]
    g << a
    g << b
    h[a] = g
    h[b] = g
  else
    s = Set.new
    s << a
    s << b
    h[a] = s
    h[b] = s
  end
end

sets = h.keys.map do |i|
  h[i]
end.uniq

sets.sort_by! do |s|
  s.size
end

puts sets.last.size