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(); boolean[] isNotPrime = new boolean[length / (n - 1) + 2]; long ans = 0; for (int i = 2; i < isNotPrime.length; i++) { if (!isNotPrime[i]) { ans += length - i * (n - 1) + 1; for (int j = 2; j * i < isNotPrime.length; j++) { isNotPrime[i * j] = true; } } } System.out.println(ans); } }