#include<stdio.h>
#include<math.h>
main(){int i,j,n,p[1000000];scanf("%d",&n);for(i=2;i<=n;i++)p[i]=1;for(i=2;i<=sqrt(n);i++)if(p[i])for(j=2;i*j<=n;j++)p[i*j]=0;j=0;for(i=2;i<=n;i++)j+=p[i];printf("%d\n",j);}