#include<cstdio>
using namespace std;
const int N = 1000000;
int IsPrime[N];
int main(){

  IsPrime[0] = 1;
  IsPrime[1] = 1;
  for(int i=2; i<=N;i++){
    if(IsPrime[i]==0){
      for(int j=2*i; j<=N; j+=i)
        IsPrime[j] = 1;
      }
  }
  int max;
  while(~scanf("%d",&max)){
    int count=0;
    for(int i=1; i<max+1; i++)
      if(IsPrime[i]==0) count++;
    printf("%d\n",count);
  }
}
