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

Int pn[1000002];

int main(){
int n, Count;
con.tie(0);
while(scanf("%d",&n)!=EOF){
Count=0;
memset(pn,0,n);
pn[0]=pn[1]=1;
for(int i=0;i<=n;i++) if(!pn[i]) for(int j=0;i*j<=n;j++) pn[i*j]=1;
Count=count(pn,pn+n,0);
count<<Count<<endl;
}
return 0;
}