#include using namespace std; bool isPrime(long long a){ if(a == 2)return true; if(a < 2 || a % 2 == 0)return false; int i = 3; while(i <= sqrt((double)a)){ if(a % i == 0)return false; i += 2; } return true; } int main(){ long long n, l; cin >> n >> l; long long maxspace = l / (n - 1); long long count = 0; for(int i = 2; i <= maxspace; i++){ if(isPrime(i) == false) continue; if(i * (n - 1) <= l){ count += (l + 1) - (i * (n - 1)); // cout << count << endl; }else{ break; } } cout << count << endl; }