#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#define ll long long int
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int n;
  int i,j;

  while(scanf("%d", &n)!=EOF){

    if(n==1){
      cout<<"0"<<endl;
      continue;
    }else if(n==2){
      cout<<"1"<<endl;
      continue;
    }
    int sum=1;
    int prime[1000000]={};
    for(i=2;i<n;i++){
      if(prime[i]==0)
	for(j=2;j*i<n;j++){
	  if(prime[i*j]==0){
	    prime[i*j]=1;
	    sum++;
	  }
	}
    }
    cout<<n-sum<<endl;
  }

}