n, m = gets.chomp.split(" ").map(&:to_i)
ar = Array.new{}
kazu = Array.new(n+1,0)
me1 = 0
me2 = 0
m.times do 
    arr = []
    a, b = gets.chomp.split(" ").map(&:to_i)
    kazu[a] += 1
    kazu[b] += 1
    if kazu[a] == 1 && kazu[b] == 1
        arr << a
        arr << b
        ar << arr
    elsif kazu[b] != 1 && kazu[a] == 1
        ar.each_with_index do |item,j|
            if item.include?(b)
                ar[j] << a
            end
        end
    elsif kazu[b] == 1 && kazu[a] != 1
        ar.each_with_index do |item,k|
            if item.include?(a)
                ar[k] << b
            end
        end
    elsif kazu[b] != 1 && kazu[a] != 1
        ar.each_with_index do |item,k|
            if item.include?(a)
                me1 = k
            end
            if item.include?(b)
                me2 = k
            end
        end
        mezirusi = ar[me1] + ar[me2]
        ar[me1] = []
        ar[me2] = []
        ar << mezirusi.uniq
    end
    ar.delete([])
end
ans = 0
ar.each do |i|
    ookisa = i.size
    ans = [ans,ookisa].max
end
puts ans