import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { solver(); } static void solver() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); if(l/(n-1)>=2){ boolean[] isPrime = isPrimeArray(l / (n - 1)); long ans = 0; for (int i = 2; i <= l / (n - 1); i++) { if (isPrime[i]) { ans += l - (n - 1) * i + 1; } } System.out.println(ans); }else{ System.out.println(0); return; } } static int count = 0; static boolean[] isPrimeArray(int max) { boolean[] isPrime = new boolean[max + 1]; Arrays.fill(isPrime, true); isPrime[0] = isPrime[1] = false; for (int i = 2; i * i <= max; i++) { if (isPrime[i]) { for (int j = 2; j * i <= max; j++) { isPrime[j * i] = false; } } } return isPrime; } }