#include<stdio.h>
#include<iostream>
#include<math.h>


using namespace std;



bool isPrime(int num) {
	if (num < 2)return false;
	if (num == 2)return true;
	if (num % 2 == 0)return false;
	int root = (int)sqrt(num);
	for (int i = 3; i <= root; i += 2) {
		if (num % i == 0)return false;
	}
	return true;
}

int main() {

	int num;
	while (cin >> num) {
		int count = 0;
		for (int i = 2; i <= num; i++) {
			if (isPrime(i))count++;
		}
		cout << count << endl;
	}


	
	//std::system("pause");
	return 0;
}
