#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<queue>
#include<complex>
#include<numeric>
#include<bitset>
#define INF 1001001001
#define EPS 0.000001

using namespace std;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef pair<int,int> pint;

int memo[1000000];

int main(){
	int i,j;
	for(i=2;i<1000000;i++) memo[i]=1;
	for(i=2;i<1000;i++){
		if(memo[i]==1){
			for(j=i;i*j<1000000;j++) memo[i*j]=0;
		}
	}
	for(i=1;i<1000000;i++) memo[i]+=memo[i-1];
	int n;
	while(cin >> n) cout << memo[n] << endl;
	return 0;
}