#include <stdio.h>
 
#define MAX_SIZE(1000001)
 
int prime[MAX_SIZE];
 
int main()
{
int n, i, j;
     
for (i = 0; i < MAX_SIZE; i++){
prime[i] = 1;
}
     
prime[0] = prime[1] = 0;
     
for (i = 2; i * i < MAX_SIZE; i++){
if (prime[i] == 1){
for (j = i * i; j < MAX_SIZE; j += i){
prime[j] = 0;
}
}
}
     
for (i = 1; i < MAX_SIZE - 1; i++){
prime[i + 1] += prime[i];
}     
while (scanf("%d", &n) != EOF){
printf("%d\n", prime[n]);
}     
return 0;
}