#include<stdio.h>

int main(){
  const int MAX_V = 1000000;
  int prime[MAX_V+1];
  int i, k, v;
  int e, f, ans;
  for(i = 2; i <= MAX_V; i++){
    prime[i] = 1;
  }
  for(i = 2; i*i <= MAX_V; i++){
    if(prime[i]){
      for(k = 2 * i; k <= MAX_V; k += i){
        prime[k] = 0;
      }
    }
  }
  for(e = 0; e < 30; e++){
    int count = 0;
    scanf("%d", &v);
    for(f = 2; f <= v; f++){
      ans = prime[f];
      if(ans == 1){
        count++;
      }
    }
    printf("%d\n", count);
  }
  return 0;
}