#include <iostream>
#include <cmath>

using namespace std;

bool isPrime(int n) {
    if (n < 2) {
        return false;
    }
    else if (n == 2) {
        return true;
    }
    else if(n%2 == 0) {
        return false;
    }
    
    double num = sqrt(n);
    for (int i = 3; i <= num; i += 2) {
        if (n%i == 0) {
            return false;
        }
    }
    return true;
}

int main() {
    int n;
    int cnt;
    while(cin >> n) {
        cnt = 0;
        for (int i = 2; i <= n; i++) {
            cnt += isPrime(i);
        }
        cout << cnt << endl;
    }
    return 0;
}
