import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int L = scan.nextInt(); scan.close(); int max = L / (N -1); ArrayList list = new ArrayList(); for(int i = 2; i <= max; i++) { if(isPrime(i)) { list.add(i); } } long cnt = 0; for(int i = 0; i < list.size(); i++) { if(L - (N - 1) * list.get(i) >= 0) { cnt += L - (N - 1) * list.get(i) + 1; } } System.out.println(cnt); } static boolean isPrime(int n) { if(n == 2) { return true; } if(n % 2 == 0) { return false; } for(int i = 3; i <= (int)Math.sqrt(n); i+=2){ if(n % i == 0) { return false; } } return true; } }