#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;

int main(void){
int unti[100002] = {0};
fill(unti,unti + 100002,0);
for(int n = 2;n < 100002;n++)
{
if(unti[n] == 0)
{
for(int a = 2;(a * n) < 100002;a++)
{
	unti[a * n]++;
}
}
}
int b;
while(cin >> b )
{
int cnt = (count(unti,unti+b+1,0) - 2);
cout << cnt << endl;
}
return 0;
}