#include using namespace std; int main() { int a[2000000] = {0},n,x,f; long long ans = 0; cin >> n >> x; for(int i = 2; i <= n; i += 2){ a[i - 2] = 1; } for(int i = 2; i <= n; i++){ if (a[i - 2] > 0) { if (a[i - 2] >= x) ans++; continue; } f = 0; for(int j = 3; j * j <= i; j += 2){ if (i % j == 0) { f = 1; break; } } if (f == 0) { for(int k = i; k <= n; k += i) { a[k - 2]++; } } } cout << ans << "\n"; return 0; }