#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){

  int n;
  int a,i,count;
  while(cin >> n){
    if(n < 1000000){
      count = 0;
      for(;1<n;n--){
	for(a=2,i=1;a<=n/2;a++)
	  if(n%a == 0){
	    i = 0;
	    break;
	  }
	if(i)
	  count++;
      }
      cout << count << endl;
    }
  }
  return 0;
}