#include <iostream>
#include <vector>
using namespace std;
#define MAX 1000000

int main() {
  vector<bool> isPrime(MAX, true);
  isPrime[0] = false;
  isPrime[1] = false;
  for (int i = 2; i * i < MAX; i++) {
    if (isPrime[i]) {
      for (int j = 2; i * j < MAX; j++) {
        isPrime[i * j] = false;
      }
    }
  }
  int n;
  while (cin >> n) {
    int ans = 0;
    for (int i = 0; i <= n; i++) {
      if (isPrime[i]) ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
