import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int length = sc.nextInt(); ArrayList primes = new ArrayList<>(); long ans = 0; for (int i = 2; i * (n - 1) <= length; i++) { if (isPrime(i, primes)) { primes.add(i); ans += length - i * (n - 1) + 1; } } System.out.println(ans); } static boolean isPrime(int x, ArrayList primes) { for (int y : primes) { if (y * y > x) { break; } if (x % y == 0) { return false; } } return true; } }