#include<iostream>
int m,n,p;void r(){p++;if(m<2)p--;else{for(int i=3;i*i<=m;i+=2)if(m%i==0){p--;break;}}}int main(){for(;!(std::cin>>n).eof();){if(n<3)p=!(n-2);else for(m=3,p=1;m<=n;m+=2)r();printf("%d\n",p);}}