require 'prime' n, l = gets.split.map(&:to_i) result = 0 Prime.each do |i| break if i * (n - 1) > l result += l - i * (n - 1) + 1 end puts result