import java.util.Scanner; public class Main { static boolean[] isPrime; 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); isPrime = new boolean[max + 1]; long cnt = 0; if(max >= 2) { aryPrime(); } for(int i = 2; i < max + 1; i++) { if(isPrime[i]) { cnt += L - (N - 1) * i + 1; } } System.out.println(cnt); } static void aryPrime(){ int l = isPrime.length; for(int i = 0; i < l; i++) { isPrime[i] = true; } isPrime[0] = false; isPrime[1] = false; for(int i = 2; i <= (int)Math.sqrt(l); i++) { if(isPrime[i]) { for(int j = i * 2; j < l; j += i) { isPrime[j] = false; } } } } }