#include<iostream>
#include<string>
#include<math.h>
using namespace std;

int main(void) {

	//0005
	/*
	int a, b, G, R, L, r;
	while (cin >> a >> b) {
		R = a;
		L = b;
		int tmp;
		if (b > a) {
			tmp = a;
			a = b;
			b = tmp;
		}
		while (1) {
			r = a%b;
			if (r == 0)break;
			a = b;
			b = r;
		}
		G = b;
		R = R / G;
		L = L / G;
		cout << G << " " << R*L * G << endl;
	}
	*/
	//0006
	/*
	string name;
	cin >> name;
	int L = name.size();
	string Ans;
	for (int i = 0; i < L; i++) {
		Ans += name.substr(L-i-1, 1);
	}
	cout << Ans << endl;
	*/
	//0007
	/*
	int Dept = 100000;
	int week;
	cin >> week;
	for (int i = 0; i < week; i++) {
		Dept = Dept * 1.05;
		if (Dept % 1000 == 0) {
			Dept = (Dept / 1000);
		}
		else {
			Dept = (Dept / 1000 + 1);
		}
		Dept = Dept * 1000;
	}
	cout << Dept << endl;
	*/
	//0008
	/*
	int a, b, c, d;
	int n;
	int count[51];
	for (int i = 0; i < 51; i++) {
		count[i] = 0;
	}
	for (a = 0; a < 10; a++) {
		for (b = 0; b < 10; b++) {
			for (c = 0; c < 10; c++) {
				for (d = 0; d < 10; d++) {
					count[a + b + c + d]++;
				}
			}
		}
	}
	while (cin >> n) {
		cout << count[n] << endl;
	}
	*/
	int n;
	int i, j;
	int flag;
	int count;
	while (cin >> n) {
		count = 4;
		if (n < 10) {
			if (n == 0 || n == 1) {
				cout << "0" << endl;
			}
			else if (n == 2) {
				cout << "1" << endl;
			}
			else if (n == 3 || n == 4) {
				cout << "2" << endl;
			}
			else if (n == 5 || n == 6) {
				cout << "3" << endl;
			}
			else if (n == 7 || n == 8 || n == 9) {
				cout << "4" << endl;
			}
		}else {
			for (i = 10; i <=n; i++) {
				flag = 0;

				for (j = 3; j < sqrt(i) + 1; j += 2) {
					if (i % 2 == 0 || i%j == 0) {
						flag = 1;
						break;
					}
				}
				if (flag == 0) {
					count++;
				}
			}
			cout << count << endl;
		}
	}
	return 0;
}