#include<iostream>

using namespace std;

int main(){
  int n, N;
  int *prime;
  int i,j;
  while(cin >> N){
    n = N + 1; 
    //init
    prime = new int[n];
    for(i=0; i<=n; i++) prime[i] = 0;

    //素数判定
    for(i=2; i*i<=n; i++){
      if(prime[i] == 0){
	prime[i] = 1; //iは素数
	for(j=2; i*j<=n; j++){//倍数ふるい落とし
	  prime[i*j] = -1;//i*jは素数じゃない
	}
      }
    }
    for(i=i; i<=n; i++){
      if(prime[i] == 0) prime[i] = 1;
    }
    
    //output
    int ans=0;
    for(i=2; i<=n; i++){
      if(prime[i] == 1) {
	ans ++;
	//cout << "prime:" << i << endl;;
      }
    }
    cout << ans << endl;

    delete[] prime;
  }
  return 0;
}