#include<cmath>
#include<cctype>
#include<cstdlib>
#include<cstdio>

#include<iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include<string>
#include<queue>
#include<map>
#include<set>
#include<utility>
#include<queue>

using namespace std;
const int MAX = 10000000;
bool isPrime[MAX];
int main(){
  cin.sync_with_stdio(false);
  fill(isPrime,isPrime+MAX,true);
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i < MAX; ++i){
    if(isPrime[i]){
      for(int j = i*2;j < MAX;j+=i){
	isPrime[j] = false;
      }
    }
  }
  int n;
  while(cin >> n){
    int ans = 0;
    for(int i = 2;i <= n;i++){
      if(isPrime[i])ans++;
    }
    cout << ans << endl;
  }
  return 0;
}