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

int main(int argc, char *argv[]) {
	int a = 999999;
	cout << a << endl;
	for(int i = 0; i < MAX_SIZE; i++)
		if(i % 2)
			preme[i] = 1;
		else {
			preme[i] = 0;
		}
	preme[2] = 1;
	preme[1] = 0;
	for(int i = 3; i <= 999999; i += 2) {
		if(preme[i]) {
			for(int j = i + i; j <= 999999; j += i)
				preme[j] = 0;
		}
			
	}
	//freopen("data.txt", "r", stdin);
	//freopen("data_test2.txt", "w", stdout);
	int n;
	while(cin >> n){
		int count = 0;
		for(int i = 1; i <= n; i++)
			if(preme[i])
				count++;
		cout << count << endl;
	}
		
}