#include <bits/stdc++.h>
using namespace std;
bool prime[100000005];
void solve() {
  memset(prime, true, sizeof(prime));
  prime[0] = prime[1] = false;
  for (int i = (2); i < ((int)sqrt(100000005)); i++) {
    if (prime[i] == true) {
      for (int j = 2; j * i <= 1000000; j++) {
        if (prime[i * j] == true) prime[i * j] = false;
      }
    }
  }
}
int main() {
  int n;
  while (cin >> n) {
    int ans = 0;
    solve();
    for (int i = (0); i < (n + 1); i++) {
      if (prime[i] == true) {
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
