#include <iostream>
#include <cstdio>

using namespace std;

#define MAX_N 10000000

int sosuu[MAX_N+1];

int main() {
	for (int i = 0; i < MAX_N; ++i)
		sosuu[i] = 1;

	sosuu[0] = sosuu[1] = 0;

	for (int i = 2; i < MAX_N; ++i)
		if (sosuu[i])
			for (int j = 2*i; j < MAX_N; j += i)
				sosuu[j] = 0;

	for (int i = 0; i < MAX_N; ++i)
		sosuu[i+1] += sosuu[i];

	int n;
	while ( scanf("%d", &n) != EOF )
		cout << sosuu[n] << endl;
}