#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

bool isPrime(int x);

int main(void) {
	int n;
	while(scanf("%d", &n) != EOF) {
		
		int count = 0;
		for(int i = 1; i < n; i++) {
			if(isPrime(i))		count++;
		}
		
		cout << count << endl;
	}
	
	return 0;
}

bool isPrime(int x) {
	if(x < 2)			return false;
	else if(x == 2)		return true;
	
	if(x % 2 == 0)		return false;
	for(int i = 3; i * i <= x; i += 2) {
		if(x % i == 0)	return false;
	}
	return true;
}