#include <bits/stdc++.h>

using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  while (cin >> n) {
    int prime_table[1000000] = {};
    for (int i = 2; i <= n; i ++) {
      if (prime_table[i] == 0) {
        for (int j = 2; j <= n / i; j ++) {
          prime_table[i * j] = 1;
        }
      }
    }
    int count = 0;
    for (int i = 2; i <= n; i ++) {
      if (prime_table[i] == 0) {
        count += 1;
      }
    }
    cout << count << endl;
  }
}
