#include <cstdio>
#include<cmath>
using namespace std;
int n,sum,c,flag;
int a[1000000] = {0};
int main()
{
	c = 1000000;
	for(;c > 0;c--){
		flag = 0;
		for(int i = 2;i <= sqrt(c);i++){
			if(c % i == 0)
				flag = 1;
		}
		if(flag == 0)
			a[c] = c;
	}
	while(scanf("%d",&n) != EOF){
		sum = 0;
		for(int j = n;j > 1;j--){
			if(a[j] != 0)
				sum++;
		}
		printf("%d\n",sum);
	}
	return 0;
}