#include<iostream>

bool isPrime(int i){
	for (int j = 2; j*j <= i; j += 2){
		if (i%j == 0)return false;
		if (j == 2)--j;
	}
	return true;
}

int main(){
	int n;
	int count = 0;
	while (std::cin >> n){
		count = 0;
		for (int i = 2; i <= n; ++i){
			if (i == 2)++count;
			else if (isPrime(i))++count;
		}
		std::cout << count << std::endl;
	}
	return 0;
}