#include<iostream>

using namespace std;

int main(){
  int n,flag=1,sum = 0;

  while(cin >> n){

    for(int i=2; i <= n; i++){
      if(i != 2 && i%2 == 0) flag = 0;
      else if(i != 3 && i%3 == 0) flag = 0;
      else if(i != 5 && i%5 == 0) flag = 0;
      else{
	for(int j=3; j < i/2; j++){
	  if(i%j == 0 ){
	    flag = 0;
	    j = i/2;
	  }
	}
      }
      if(flag == 1) sum++;
      flag = 1;
    }
    cout << sum <<endl;
    sum = 0;
  }
}