#include<bits/stdc++.h>
#define rep(i, x) for(int i = 0; i < (int)(x); i++)
#define reps(i, x) for(int i = 1; i <= (int)(x); i++)
#define UNIQUE(v) v..erase( unique(v.begin(), v.end()), v.end() );
#define Size(x) ((int)(x).size())
using namespace std;

const int N = 1000000;
int for_erat[N];
vector<int> prime;
void erat(){
    for(int i = 0; i < N; i++){
        for_erat[i] = 1;
    }
    for(int i = 2; i < sqrt(N); i++){
        if(for_erat[i]){
            for(int j = 0; i * (j + 2) < N; j++){
                for_erat[i *(j + 2)] = 0;
            }
        }
    }

    for(int i = 2; i < N; i++){
        if(for_erat[i]){
            prime.push_back(i);
        }
    }
}

int main(){
	erat();
	int n;
	while(cin >> n){
		int cnt = 0;
		rep(i, Size(prime)){
			if(prime[i] <= n) cnt++;
			else break;
		}
		cout << cnt << endl;
	}
	return 0;
}

