#include<bits/stdc++.h>
using namespace std;
long long u, o[5] = {0, 0, 1, 2, 2}, ans = 1;
bool f[10000010];
int main()
{
cin >> u;
if(u <= 4)
{
cout << o[u];
return 0;
}
for(int i = 2; i <= u; i ++)
{
if(!f[i])
{
for(int j = 2; j * i <= u; j ++)
{
f[j * i] = 1;
}
}
}
for(int i = 3; i <= u; i ++)
{
if(!f[i])
{
ans ++;
}
}
cout << ans;
return 0;
}
求指导