#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;

int main(void){
  int n;
  int p[1000000];
  p[0] = p[1] = 0;
  p[2] = 1;
  int ans = 0;
  for(int i = 3; i <= 1000000; i += 2){
    bool flag = true;
    for(int j = 3; j <= sqrt(i); j += 2){
      if(i % j == 0){
	flag = false;
      }
    }
    if(flag)
      ans++;
    p[i] = ans;
  }
  while(cin >> n){
    cout << p[n] << endl;
  }
  return 0;
}