#include <iostream>
using namespace std;
#define MAX 1000000

int main()
{
	int n;
	int a[MAX];
	int counter;
	
	a[0] = 0;
	a[1] = 0;
	for (int i = 2; i < MAX; i++) {
		a[i] = 1;
	}
	
	int j = 2;
	while (j < MAX) {
		if (a[j] == 0) {
			j++;
		} else {
			for (int k = j *2; k < MAX; k += j)
				a[k] = 0;
			j++;
		}
	}
	
	while (cin >> n) {
		counter = 0;
		for (int i = 2; i <= n; i++)
			if (a[i])
				counter++;
		cout << counter << "\n";
	}
		
	return 0;
}