#include <iostream>
#include <stdio.h>
#include <string>
#include <queue>
#include <cmath>

#define int64 long long int

using namespace std;

int main()
{
	int n;
	bool p[1000000] = {0};

	for(int i=2; i<=1000; i++){
		if(!p[i])
			for(int j=2*i; j<1000000; j+=i) p[j] = true;
	}

	while(cin >> n){
		int count = 0;
		for(int i=2; i<=n; i++)
			if(!p[i]) count++;
		cout << count << '\n';
	}

	return 0;
}