#define _CRT_SECURE_NO_WARNINGS

#include<fstream>
#include<iostream>
#include<string>
#include<iomanip>
#include<list>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

int data[999999] = { -1 };
bool notprime[999999] = { false };

int main(int argc, char **argv){
	int n;
	int cnt;
	while (cin >> n) {
		cnt = 0;
		for (int i = 2; i < n; i++) {
			if (!notprime[i]) {
				cnt++;
				for (int j = 2; j <= n / i; j++) {
					notprime[i * j] = true;
				}
			}
			if (i >= sqrt(n)) {
				for (int k = i + 1; k <= n; k++) {
					if (!notprime[k]) {
						cnt++;
					}
				}
				break;
			}
		}
		cout << cnt << endl;
	}
	return 0;
}