#include<iostream>
#include<algorithm>
using namespace std;
int prime[1000005];
bool sta[1000005];
int main()
{
int n,sum=0,i,j;
scanf("%d",&n);
for(i=2;i<=n;i++){
if(!sta[i])prime[sum++]=i;
for(j=0;prime[j]<=n/i;j++){
sta[prime[j]*i]=true;
if(i%prime[j]==0)break;
}
}
printf("%d\n",sum);
return 0;
}