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

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