#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <numeric>
using namespace std;

bool isPrime(int num) {
    if(num < 2) return(false);
    for(int r = 2; r * r <= num; r++) {
        if(num % r == 0) return(false);
    }
    return(true);
}

int main(void) {
    int num;
   
    while(cin >> num) {
        int prime[num + 1];
        memset(prime, -1, sizeof(prime));
        prime[0] = prime[1] = 0;
        int sum = 1;
        
        for(int r = 3; r <= num; r += 2) {
            if(prime[r] != -1) continue;
            if(prime[r] % 2 == 0) continue;
            if(isPrime(r)) {
                prime[r] = 1;
                sum++;
                for(int c = 2 * r; c <= num; c += r) prime[c] = 0;
            }
        }
        
        cout << sum << endl;
    }
}