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

int main(){
	int n,count = 0;

	cin >> n;
	int *arr = new int[n];

	for(int i = 0; i < n + 1; i++) arr[i] = 1;

	for(int i = 2; i < sqrt(n); i++){
		if(arr[i]) {
			for(int j = 0; i * (j + 2) <= n; j++) {
				arr[i * (j + 2)] = 0;
			}
		}
	}
	for(int i = 2; i <= n; i++){
		if(arr[i]) count++;
	}

	cout << count << "\n";

	delete[] arr;
}