#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int p[1000001] = {0};
  for (int i = 3; i <= 1000001; i += 2) p[i] = 1;
  p[2] = 1;
  for (int i = 3; i <= 1000; i += 2) {
    if (p[i] == 1) {
      for (int j = 2 * i; j <= 1000001; j += i) p[j] = 0;
    }
  }
  while (cin >> n) {
    int count = 0;
    if (2 <= n) count++;
    for (int i = 3; i <= n; i += 2) {
      if (p[i]) count++;
    }
    cout << count << endl;
  }
  return 0;
}
