#include<iostream>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

const int MAX = 1000000;

bool prime[MAX];
int c[MAX];

int main() {
  rep (i, MAX) prime[i] = true;
  prime[0] = prime[1] = false;
  for (int i = 0; i * i <= MAX; ++i) {
    if (prime[i]) {
      for (int j = i * i; j < MAX; j += i) prime[j] = false;
    }
  }
  rep (i, MAX - 1) c[i + 1] = c[i] + (prime[i + 1] ? 1 : 0);
  int n;
  while (cin >> n) {
    cout << c[n] << endl;
  }
}