#include <bits/stdc++.h>
#define debug(x) cerr << #x << ": " << x << '\n';
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = (int)1e9;

#ifndef SIEVE
#define SIEVE
// エラストテネスの篩, o(n)程度
// n以下の素数の数を返す, prime[i]: i番目の素数, is_prime[i]: iが素数であるか
int sieve(int n, int prime[] = nullptr, bool is_prime[] = nullptr){
	bool flag0 = false, flag1 = false;
	if(prime == nullptr){
		flag0 = true; prime = new int[n];
	}
	if(is_prime == nullptr){
		flag1 = true; is_prime = new bool[n + 1];
	}

	int p = 0;
	fill(is_prime, is_prime + n + 1, 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;
		}
	}

	if(flag0) delete prime;
	if(flag1) delete is_prime;

	return p;
}
#endif

const int N = (int)1e6;
int prime[N];
bool is_prime[N+1];
int res[N];

int main(void){
    int num = sieve(N, prime, is_prime);

    // for(int i = 0; i < 30; i++) printf("prime[%d] = %d\n", i, prime[i]);
    // for(int i = 1; i < N; i++){
    //     res[i] = res[i-1] + is_prime[i];
    // }

    int n;

    while(scanf("%d", &n) != EOF){
        cout << upper_bound(prime, prime + num, n) -prime << '\n';        
    }

    return 0;
}
