#include <bits/stdc++.h>
using namespace std;
bool us[1000010] = {false};
int p[1000010] = {0};
int main() {
  p[0] = 2;
  for (int i = 0; i <= 1000010; i += 2) {
    us[i] = true;
  }
  int cnt = 1;
  for (int i = 3; i <= 1000010; i += 2) {
    int q = 0;
    if (us[i] == true)
      continue;
    else if (us[i] == false) {
      p[cnt] = i;
      cnt++;
      us[i] = true;
      q = i;
      for (int j = q + q; j <= 1000010; j += q) {
        us[j] = true;
      }
    }
  }
  int n;
  while (~scanf("%d", &n)) {
    int x = 0;
    while (1) {
      if (p[x] > n) break;
      x++;
    }
    printf("%d\n", x);
  }
  return 0;
}
