import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); int dlim = L/(N-1); boolean [] b = new boolean [dlim+1]; long count=0L; if(dlim>=2){ count+=L-2*(N-1)+1; } for(int i=3; i<=dlim; i+=2){ if(b[i]==false){ count+=L-i*(N-1)+1; int k=2; while(i*k<=dlim){ b[i*k]=true; k++; } } } System.out.println(count); } }