#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

inline void era(vector<bool> &prime, int num);

using namespace std;

int main(void){
  int num;

  while(cin >> num){
    vector<bool> prime((num+1), true);
    prime[0] = false;
    prime[1] = false;
    era(prime, num);
    cout << count(prime.begin(), prime.end(), true) << endl;
  }
  return 0;
}

void era(vector<bool> &prime, int num){
  int N = 2;
  while (N <= num){
    int count = 2;
    while ((count*N) <= num){
      prime[count*N] = false;
      ++count;
    }
    ++N;
  }
}