#include<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++) 
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vector <vs>;
//g++ -std==c++14
//setprecision(10)
int prime[1000000];
void eratosthenes(){
    for(int i = 0; i < 1000000; i++)    prime[i] = 1;
    prime[0] = prime[1] = 0;
    for(int i = 0; i * i <= 1000000; i++)
        if(prime[i])
            for(int j = i * 2; j < 1000000; j += i)
                prime[j] = 0;
}

int main(){
    int n;
    eratosthenes();
    while(cin >> n){
        int ans = 0;
        rep(i, n + 1)if(prime[i])ans++;
        cout << ans << endl;
    }
}