#include <stdio.h>

const int MAX = 999999;
int Prime[MAX];

void makePrimeList(int n) {
  Prime[0] = 1;
  int i, j;
  for (i = 2; i <= n / 2; i++) {
    for (j = 2; i * j <= n; j++) {
      Prime[i * j - 1] = 1;
    }
  }
}

int isPrime(int n) {
  if (Prime[n - 1] == 0) return 1;
  return 0;
}

int main() {
  
  int n, i, cnt, oldMax = 0;
  
  int init;
  for (init = 0; init <= MAX; init++) { Prime[init] = 0; }
  
  while(1) {
    if (scanf("%d", &n) == EOF) break;
    
    if (oldMax < n) {
      makePrimeList(n);
      oldMax = n;
    }
    cnt = 0;
    
    for (i = 1; i <= n; i++) {
      if (isPrime(i) == 1) cnt++;
    }
    
    printf("%d\n", cnt);
  }
  return 0;
}