n, m = gets.split.map(&:to_i)
h = {}
s = []
n.times{h[_1+1]=[]}
m.times do
  a, b = gets.split.map(&:to_i)
  if s.empty?
    s << [a, b]
  else
    first_set = true
    s.each_with_index do |t, i|
      if t.include?(a) || t.include?(b)
        s[i] = (t + [a,b]).uniq
        first_set = false
        break
      end
    end
    s << [a, b] if first_set
  end
end
ans = 1
s.each do |t|
  ans = [ans, t.size].max
end
puts ans
