#include <iostream>
#include <cmath>
using namespace std;

const int N = 1000010;

bool prime[N];
int number[N];
void init() {
  for (int i=0;i<N;i++) prime[i] = true;
  prime[0] = prime[1] = false;
  for (int i=0;i<=sqrt(N);i++) {
    if (prime[i]) {
      for (int j=i*2;j<N;j+=i) prime[j] = false;
    }
  }
  number[0] = 0;
  for (int i=0;i<N-1;i++) {
    number[i + 1] = number[i] + prime[i + 1];
  }
}

int main() {
  int n;
  init();
  while (cin >> n) {
    cout << number[n] << endl;
  }
}