#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e6 + 7;
int pr[N], ct;
bool noP[N];
void euler(int n) {
noP[1] = true;
for (int i = 2; i < n; i++) {
if (!noP[i]) pr[++ct] = i;
for (int j = 1; pr[j]*i < n; j++) {
noP[pr[j]*i] = true;
if (i%pr[j] == 0)
break;
}
}
}
int main() {
int x, y;
scanf("%d%d", &x, &y);
if (x > y) swap(x, y);
euler(y);
for (int i = 1; i <= ct; i++) {
if (pr[i] > x) {
printf("%d", ct - i+1);
return 0;
}
}
return 0;
}
感谢感谢 QWQ