#include <iostream>
#include <cstring>
using namespace std;
#define MAX_SIZE 1000100
#define N 999999
int preme[MAX_SIZE];


bool isPrime(int n) {
	for(int i = 2; i <= n / 2; i++)
		if(n % i == 0)
			return false;
	return true;
}

int main(int argc, char *argv[]) {
	memset(preme, 0, sizeof(preme));
	int index = 0;
	for(int i = 1; i <= N; i += 2)
		preme[i] = 1;
	
	for(int i = 3; i <= 999999; i += 2) {
		if(preme[i]) {
			for(int j = i + i; j <= 999999; j += i)
				preme[j] = 0;
		}
			
	}
	
	int n;
	while(cin >> n) {
		int count = 0;
		for(int i = 1; i <= n; i++)
			if(preme[i])
				count++;
		cout << count << endl;
	}
		
}