#include<iostream>
#include<cmath>
using namespace std;

int main(){
	int num, cou, i, j, flag;
	
	while(cin >>num){
		cou = 0;
		for(i = 2; i <= num; i++){
			for(j = 2; j < i; j++){
				if(i % j == 0){
					flag = 1;
					break;
				}
			}
			if(flag == 0) cou++;
			flag = 0;
		}
		if(num % 2 == 0) cou++;
		cout <<cou<<endl;
	}
	
	return 0;
}