#include <iostream>
using namespace std;
// エラトステネスのふるい
int main() {
  int n, prime[1000000];
  while (cin >> n) {
    for (int i = 0; i <= n; i++) {
      prime[i] = 0;
    }
    prime[0] = 1;
    prime[1] = 1;
    
    int count = 0;
    for (int i = 0; i <= n; i++) {
      if (prime[i] == 0) {
	count++;
	for (int j = i; j <= n; j += i) {
	  prime[j] = 1;
	}
      }
    }
    cout << count << endl;
  }
  return 0;
}
