#include <iostream>
using namespace std;

int main(){
	char nums[1000000];
	int n;
	for(int i = 2; i < 1000000; i++)
		nums[i] = 1;
	for(int j = 2; j < 1000; j++)

		for(int k = 2; j * k <= 1000000; k++)
			nums[j * k] = 0;
	while(cin >> n){
		int count = 0;
		for(int l = 2; l <= n; l++)
			if(nums[l])
				count++;
		cout << count << endl;
	}
	return 0;
}