#include <bits/stdc++.h> 
using namespace std; 
typedef long long ll;




int main(){


	int Nmax = 1000000;
	bool isp[Nmax]={};
	int count[Nmax]={};

	isp[2] = true;
	for(int i=3;i<Nmax;i+=2){
		isp[i] = true;
	}

	for(int i=3;i<Nmax;i+=2){
		if(isp[i]){
			int j = i*2;
			while(j<Nmax){
				isp[j] = false;
				j += i;
			}
		}
	}

	for(int i=1;i<Nmax;i++){
		count[i] = count[i-1] + isp[i];
	}

	int n;
	while(cin >> n){
		cout << count[n] << endl;
	}

}
