import java.io.*; import java.util.*; public class Main_yukicoder407 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Printer pr = new Printer(System.out); int n = sc.nextInt(); int l = sc.nextInt(); Prime p = new Prime(l); List primes = p.getPrimeList(); long ret = 0; for (int i : primes) { long tmp = (long)i * (n - 1); if (tmp > l) { break; } ret += l - tmp + 1; } pr.println(ret); pr.close(); sc.close(); } @SuppressWarnings("unused") private static class Prime { private int n; private List primes; private BitSet p; Prime(int n) { this.n = n; p = new BitSet(n / 2); int m = (int)Math.sqrt(n); for (int i = 1; i <= m; i++) { if (p.get(i - 1)) { continue; } for (int j = 2 * i * (i + 1); 2 * j + 1 <= n; j += 2 * i + 1) { p.set(j - 1); } } } boolean isPrime(int n) { if (n == 2) { return true; } if (n == 1 || (n & 0x1) == 0) { return false; } return !p.get(n / 2 - 1); } List getPrimeList() { if (primes != null) { return primes; } primes = new ArrayList<>(); if (n >= 2) { primes.add(2); for (int i = 1; 2 * i + 1 <= n; i++) { if (!p.get(i - 1)) { primes.add(2 * i + 1); } } } return primes; } private static boolean isPrime(long n) { if (n == 2) { return true; } if (n == 1 || (n & 0x1) == 0) { return false; } for (long i = 3; i * i <= n; i += 2) { if (n % i == 0) { return false; } } return true; } } @SuppressWarnings("unused") private static class Scanner { BufferedReader br; Iterator it; Scanner (InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } String next() throws RuntimeException { try { if (it == null || !it.hasNext()) { // it = Arrays.asList(br.readLine().split(" ")).iterator(); it = Arrays.asList(br.readLine().split("\\p{javaWhitespace}+")).iterator(); } return it.next(); } catch (IOException e) { throw new IllegalStateException(); } } int nextInt() throws RuntimeException { return Integer.parseInt(next()); } long nextLong() throws RuntimeException { return Long.parseLong(next()); } float nextFloat() throws RuntimeException { return Float.parseFloat(next()); } double nextDouble() throws RuntimeException { return Double.parseDouble(next()); } void close() { try { br.close(); } catch (IOException e) { // throw new IllegalStateException(); } } } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }