N, M = gets.split.map &:to_i
link = M.times.map{ gets.split.map(&:to_i).sort }&.sort
count = 0
idx = Array.new(200005)
link.each do |a, b|
    if !i = idx[a] || idx[b]
        idx[a] = count
        idx[b] = count
        count += 1
    else
        idx[a] = i
        idx[b] = i
    end
end
calc = idx.tally.reject{|k, v| !k}.values.max
p calc ? calc : 1