#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
using namespace std;
bool dp[1000001] = {};
int sosuu() {
	dp[1] = true;
	for (int i = 2;i <= 1000;++i) {
		if (dp[i] == false) {
			for (int q = 2;q <= 1000000 / i + 1;++q) {
				dp[i*q] = true;
			}
		}
	}
	return 0;
}
int main() {
	sosuu();
	int n = 0;
	while (cin >> n) {
		int count = 0;
		for (int i = 1;i <= n;++i) {
			if (dp[i] == false) count++;
		}
		printf("%d\n", count);
	}
}
