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

int main(){
	int n;
	while(cin >> n){
		int counter = 0;
		if(n != 1)counter++;
		for(int i = 3; i <= n; i += 2){
			for(int j = 2; j <= sqrt(i); j++){
				if(i % j == 0)goto divisible;
			}
			counter ++;
			divisible:;
		}
		cout << counter << endl;
	}
}
