#include<iostream>
using namespace std;

int p[1000010];

int main(){
	int n;
	int count;

	//エラトステネスの篩
	//素数のリストをつくる
	for (int i = 0; i <= 1000000; i++) p[i] = 1;
	p[0] = p[1] = 0;
	for (int i = 2; i*i <= 1000000; i++){
		if (p[i] == 1){
			for (int j = 2; i*j <= 1000000; j++){
				p[i*j] = 0;
			}
		}
	}

	//素数のカウント
	while (cin >> n){
		count = 0;
		for (int i = 0; i <= n; i++){
			if (p[i] == 1)count++;
		}
		cout << count << endl;
	}

	return 0;
}
