#include <iostream>
#include <cstdio>
using namespace std;
const int N = 1e6 + 10;
int primes[N], cnt;
bool st[N];
void get_primes(int n)
{
for (int i = 2; i <= n; i ++ )
{
if (!st[i]) primes[cnt ++ ] = i;
for (int j = i + i; j <= n; j += i) st[j] = true;
}
}
int main()
{
int x;
scanf("%d", &x);
get_primes(x);
printf("%d\n", cnt);
return 0;
}
Orz
我和大佬头像一样orz
好家伙,葫芦兄弟