require'prime' n,l=gets.split.map(&:to_i) r=0 Prime.each(l/(n-1)){|e| x=-~l-e*(n-1) r+=x } p r