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

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