#include<iostream>
#include<cstdio>
#include<vector>

using namespace std;

vector<int>soe(int n);

int main(void)
{
	int num, pn;
	int count = 0;
	
	while(cin >> num){
		vector<int>test(num);
		test = soe(num);
		
		for(int i = 0; i < num; i++){
			if(test[i])
			count++;
		}
		cout << count <<endl;
	}
	return 0;
}

vector<int>soe(int n){
	vector<int>hyo(n);
	for(int i = 2; i < n; i++)
	hyo[i] = i;
	for(int i = 2; i*i < n; i++){
		if(hyo[i])
		for(int j = i*i; j < n; j += i){
			hyo[j] = 0;
		}
	}
	return hyo;
}