#include <iostream>

int PrimeNumberCount(int*, int);

const unsigned int MAX_NATURAL_NUMBER = 1000000;

int main(){
	int BoolPrimeNumber[MAX_NATURAL_NUMBER] = { 1, 1 };
	int NaturalNumber;
	for (int i = 2; i * i < MAX_NATURAL_NUMBER; ++i){
		if (!BoolPrimeNumber[i]){
			for (int j = i * 2; j < MAX_NATURAL_NUMBER; j += i){
				BoolPrimeNumber[j] = 1;
			}
		}
	}
	while (std::cin >> NaturalNumber){
		std::cout << PrimeNumberCount(BoolPrimeNumber, NaturalNumber) << std::endl;
	}
}

int PrimeNumberCount(int* BoolPrimeNumber, int NaturalNumber){
	int count = 0;
	for (int i = 2; i < NaturalNumber + 1; ++i){
		if (BoolPrimeNumber[i] == 0){
			++count;
		}
	}
	return count;
}
