#include <iostream>
#include <vector>
using namespace std;

int main() {
  int N = 1000000;
  vector<int> table(N, 1);
  table[0] = table[1] = 0;
  for (int i = 2; i * i < N; i++)
    if (table[i])
      for (int j = i * 2; j < N; j += i)
        table[j] = 0;

  int x;
  while(cin >> x) {
    int ans = 0;
    for (int i = 2; i <= x; i++) {
      if (table[i])
        ans++;
    }
    cout << ans << endl;
  }
}

