#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <vector>
#include <queue>
#include <string>
#include <complex>
using namespace std;

#define rep(i,n) for(int i=0; i<n; i++)
#define repa(i,s,e) for(int i=s; i<=e; i++)
#define repd(i,s,e) for(int i=s; i>=e; i--)

typedef long long ll;
typedef vector<int> vi;

const int MAX_N = 1000000;
bool prime[1000000];
int np[1000000];

void eratosthenes() {
	fill(prime, prime+MAX_N, true);
	prime[0] = prime[1] = false;
	for(int i=2; i<=MAX_N; i++) {
		if(prime[i]) {
			for(int j=i<<1; j<=MAX_N; j+=i) {
				prime[j] = false;
			}
		}
	}

	fill(np, np+MAX_N, 0);
	for(int i=1; i<=MAX_N; i++) {
		if(prime[i]) {
			np[i] = np[i-1] + 1;
		} else {
			np[i] = np[i-1];
		}
	}
}

int main() {
	eratosthenes();

	int n;
	while(scanf("%d\n", &n)!=EOF) {
		printf("%d\n", np[n]);
	}
}