#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
using namespace std;

int is_prime(int N){

	int root = sqrt(N);
	int i;
	for(i = 3; i<= root; i+=2){
		if(N%i==0)
			return 0;
	}
	if(i>root)
		return 1;
}

int main(){

	int A;
	int count = 0;



	while( scanf("%d", &A) != EOF ){
		count = 1;

		if(A<2) count=0;
		else if (A==2) count=1;
		else{
			for(int i=3; i<=A; i+=2){
				if(is_prime(i) == 1)
					count++;
			}
		}

		printf("%d\n", count);
	}


	return 0;
}