#include <stdio.h>
const int MAX_V = 1000000;
int prime[MAX_V+1];
int sum;
int main(){
 int i, k, v, n, left, right;
 while(scanf("%d", &n) != EOF) { 
 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;
   }
  }
 }
 sum= 0; 
 for(i= 0; i <= n; i++){
  sum = sum + prime[i];
 }
 printf("%d\n", sum);
 }
 return 0;
}