#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;

const int MAX_N = 1000000;

int cnt = 0;
int prime[MAX_N], vis[MAX_N];

void init() {
  memset(vis, 0, sizeof(vis));
  int m = sqrt(MAX_N + 0.5);
  for (int i = 2; i <= m; i++) if (!vis[i]) {
    for (int j = i * i; j <= MAX_N; j += i) {
      vis[j] = 1;
    }
    prime[cnt++] = i;
  }
}

int main() {
  init();
  int n;
  while (scanf("%d", &n) == 1) {
    printf("%ld\n", upper_bound(prime, prime + cnt, n) - prime);
  }
  return 0;
}