import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] str = br.readLine().split(" "); br.close(); int num = Integer.parseInt(str[0]) - 1; int len = Integer.parseInt(str[1]); long count = 0; int n = len / num; if(n==0){ System.out.println(0); return; } int[] prime = new int[n]; int i, j,primeNum; prime[0] = 0; for (i = 1; i < n; i++) { prime[i] = 1; } for (i = 1; i < n; i++) { if (prime[i] == 1) { primeNum = i + 1; for(j=i+primeNum;j