/*-*-coding:utf-8-*-*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <cmath>
#include <stack>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
  int n;

  while(cin >> n, !cin.eof()) {
    int ans = 0;
    int flag = 0;

    if(n >= 2) ans++;    
    for(int i = 3; i <= n; i+=2) {
      for(int j = 3; j <= sqrt(i); j+=2) {
	if(i % j == 0) {
	  flag = 1;
	  break;
	}
      }
      if(flag == 0) ans++;
    }    
    cout << ans << endl;
  }
  
  return 0;
}