#include <bits/stdc++.h>
using namespace std;
int list[1000001], p[78498];
int sum[1000000];
void getp() {
  p[0] = 2;
  int key = 0;
  for (int i = 0; i <= 1000000; i++) list[i] = i % 2;
  for (int i = 3; i <= 1000000; i += 2)
    if (list[i]) {
      p[++key] = i;
      for (int j = i + i; j <= 1000000; j += i) list[j] = 0;
    }
}
int main() {
  getp();
  for (int i = 0; i < 1000000; i++) sum[i] = 0;
  for (int i = 0; i <= 78497; i++) sum[p[i]] = 1;
  for (int i = 1; i < 1000000; i++) sum[i] += sum[i - 1];
  int n;
  while (cin >> n) cout << sum[n] << endl;
  return 0;
}
