#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define N 999999
char num[N];
void furui(){
  int i, divide;
  for(i = 0; i < N; i++){
    num[i] = 1;
  }
  num[0] = 0;
  num[1] = 0;
  for(divide = 2; divide <= sqrt(N); divide++){
    if(num[divide] == 0) continue;
    for( i = 0; i < N; i++){
      if(i % divide == 0){
        num[i] = 0;
      }
    }
    num[divide] = 1;
  }
}

int main(void){
  int c, i, j;
  char buf[7];
  long int n;
  long int count = 0L;

  furui();

  for(j = 0; j < 30; j++){
    for(i = 0; ;i++){
      c = getchar();
      if(c == EOF || c == '\n'){
        buf[i] = '\0';
        break;
      }
      buf[i] = c;
    }
    n = atol(buf);
    for(i = 1; i <= n; i++){
      if(num[i] == 1) count++;
    }
    printf("%ld\n", count);
    if(c == EOF) break;
  }
  return 0;
}