#include <iostream>
using namespace std;
#define MAX 1000000;
int N;

int prime[MAX];


int main(){
	prime[0]=1;
	prime[1]=1;
	prime[2]=0;
	prime[3]=0;
	for(int i=0;i*i<=MAX;i++) {
		if(prime[i]==1) continue;

		for(int t = i*2;t<MAX;t+=i)
			prime[i]=1;
	}

	while(cin.eof()){
		int m = 0;
		cin >> N;
		for(int i =0;i<=N;i++)
			if(prime[i]==0)
				m++;

		cout << m << endl;
	}

	return 0;
}