#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<string>
using namespace std;

bool isPrime(int num) {
	if (num == 1)return false;
	if (num == 2)return true;


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


int main() {

	int num;
	int count;
	while (cin >> num) {
		count = 0;
		if (num >= 2)count++;
		for (int i = 1; i <= num; i += 2) {
			if (isPrime(i))count++;
		}
		printf("%d\n", count);

	}

	//system("pause");
	return 0;
}
