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