#include <stdio.h>
#include <iostream>
#include <cmath>

int prime(int n);
int main (void){
	int n;
	while(~scanf("%d",&n)){
		std::cout << prime(n) << std::endl;
	}

	return 0;
}

int prime(int n){
	bool *flag = new bool[n];
	int res=0,i=0;
	for(i=0;i<=n;flag[i++]=0);
	for(i=2;i<=n;){
		for(int j=2;i*j<=n;j++)
			flag[i*j]=1;
		for(i++;flag[i]==1 ;i++);

	}
	for(i=0;i<=n;i++)
		res += flag[i]?0:1;
	delete [] flag;
	return res-2;
}