#include<iostream>

using namespace std;

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

  while(cin >> n){
    if(n == 1) cout << 0;

    for(int i=2; i <= n; i++){
      for(int j=2; j < i; j++){
	if(i%j == 0 ) flag = 0;
      }
      if(flag == 1) sum++;
      flag = 1;
    }
    cout << sum <<endl;
    sum = 0;
  }
}