#include <algorithm>
#include <sstream>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <stack>
#include <stdio.h>
#include <string>
#include <queue>
#include <vector>
using namespace std;

bool N[1000000];

bool primeNumber(int num) {
	if (N[num]) return true;
	else if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return N[num] = true;
}

int main()
{
	int n;
	while (cin >> n && n != EOF) {
		int cnt = 0;
		for (int i = n; i > 1; i--) {
			if (primeNumber(i)) cnt++;
		}
		cout << cnt << endl;
	}
}
