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

int main(void)
{
	int prime[168] = {0};
	unsigned long n;
	prime[0] = 2, prime[1] = 3;

	for(int i = 5; i < 1000; i += 2) {
		bool p_flag = true;
		int j;
		for(j = 0; prime[j] != 0; j++) {
			if(i % prime[j] == 0) {
				p_flag = false;
				break;
			}
		}
		if(p_flag == true) {
			prime[j] = i;
		}
	}

	while(cin >> n){
		unsigned long cnt = 2;

		if(n == 1) {
			cout << 0 << endl;
			continue;
		} else if(n == 2) {
			cout << 1 << endl;
			continue;
		} else if(n == 3 || n == 4) {
			cout << 2 << endl;
			continue;
		}

		for(unsigned long i = 5; i <= n; i += 2) {
			bool p_flag = true;
			for(int j = 1; prime[j] <= (int)sqrt((double)i) + 1; j++) {
				if(i % prime[j] == 0) {
					p_flag = false;
					break;
				}
			}
			if(p_flag == true) {
				cnt++;
			}
		}

		cout << cnt << endl;
	}
	
	return 0;
}