#include <iostream>
using namespace std;

int main(void)
{
  int prm[1000000];
  for (int i = 0; i < 1000000; i++) prm[i] = 1;
  prm[0] = prm[1] = 0;
  for (int i = 2; i < 1000000; i++) {
    for (int j = 2; i*j < 1000000; j++) {
      prm[i*j] = 0;
    }
  }
  int n;
  while (cin >> n) {
    int ans = 0;
    while (n) {
      if (prm[n]) ans++;
      n--;
    }
    cout << ans << endl;
  }

  return 0;
}