#include <iostream>
using namespace std;
int a[1000000][2];
int main()
{
  int i,j,k,n;
  k = 0;
  for(i=2;i<1000000;i++){
    if(!a[i][0]){
      k++;
      for(j=2;i*j<1000000;j++){
	a[i*j][0] = 1;
      }
    }
    a[i][1] = k;
  }
  while(cin >> n){
    cout << a[n][1] << endl;
  }
  return 0;
}