#include<iostream>
#include<cmath>

using namespace std;

int main(){
	int n, k, i, c;
	bool flag = 0;
	while(cin >> n){
		c = 0;
		for(i = 2; i <= n; i++){
			flag = 0;
			if(i == 2 || i == 3) c++;
			else{
				for(int j = 3; j <= sqrt(n); j+=2){
					if(i % 2 == 0){
						flag = 0;
						break;
					}
					else if(i % j == 0){
						flag = 0;
						break;
					}
					else flag = 1;
				}
				if(flag == 1) c++;
			}
		}
		cout << c << endl;
	}
	return 0;
}