#include"bits/stdc++.h"
using namespace std;

#define ll long long
#define INF INT_MAX/3
#define pi 2*acos(0.0)
#define eps 1e-14

const int MAX_N = 1e+3;
const int MAX_M = 1e+2;
int n;
int a[MAX_N];
bool is_prime[1000000];
int prime[1000000];

int sieve(int n) {
	int p = 0;
	for (int i = 0; i <= n; i++) is_prime[i] = true;
	is_prime[0] = is_prime[1] = false;
	for (int i = 2; i <= n; i++) {
		if (is_prime[i]) {
			prime[p++] = i;
			for (int j = 2 * i; j <= n; j += i) is_prime[j] = false;
		}
	}
	return p;
}

int main() {
	while (cin >> n)
		cout << sieve(n) << endl;
	return 0;
}