#include <cstdio>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#define min(a,b)    (((a) < (b)) ? (a) : (b))
#define max(a,b)    (((a) > (b)) ? (a) : (b))
#define abs(x)    ((x) < 0 ? -(x) : (x))
#define INF 0x3f3f3f3f
#define delta 0.85
#define eps 1e-3
#define PI 3.14159265358979323846
#define MAX_N 1000005
using namespace std;
int cnt[MAX_N];
bool is_prime[MAX_N];

void sieve(int n){
	int limit = sqrt(n);
	for(int i = 0; i <= n; i++) is_prime[i] = 1;
	is_prime[0] = is_prime[1] = 0;
	cnt[0] = cnt[1] = 0;
	for(int i = 2; i <= n; i++){
		if(is_prime[i]){
			cnt[i] = cnt[i - 1] + 1;
			if(i <= limit){
				for(int j = i * i; j <= n; j += i) is_prime[j] = 0;
			}
		}
		else cnt[i] = cnt[i - 1];
	}
}

int main(){
	int n;
	sieve(MAX_N);
	while(~scanf("%d", &n)){
		printf("%d\n", cnt[n]);
	}
	return 0;
}


