#include <cstdio>
#include <iostream>

using namespace std;

const int MAX_N = 1000000;

int N;

int len;
bool isPrime[MAX_N];
int num[MAX_N];				//the number of prime less than i

void sieve(){
	//init
	fill(isPrime, isPrime + MAX_N, true);
	isPrime[0] = isPrime[1] = false;
	num[0] = num[1] = 0;
	for(int i = 2; i < MAX_N; i ++){
		if(isPrime[i]){
			num[i] = num[i - 1] + 1;
			for(int j = 2 * i; j < MAX_N; j += i)
				isPrime[j] = false;
		}
		else{
			num[i] = num[i - 1];
		}
	}
}

int main(int argc, char const *argv[]){

	sieve();
	while(scanf("%d", &N) != EOF){
		printf("%d\n", num[N]);
	}

	return 0;
}