#include<iostream>
#include<cmath>
using namespace std;
bool isprime(int n) {
	if (n == 2)return true;
	for (int i = 3; i <= sqrt(n); i += 2) if (n%i == 0)return false;
	return true;
}
int main() {
	long long n; while(cin >> n){
		long long sum;
		if (n == 1)sum = 0;
		else {
			sum = 1;
			for (int i = 3; i < n + 1; i += 2) {
				if (isprime(i))sum++;
			}
		}
		cout << sum << '\n';
	}
	return 0;
}