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