#include <bits/stdc++.h>
#define MAX_N 1000000
using namespace std;
bool prime[MAX_N];
int table[MAX_N];

void initialize() {
    int p = 0;
    memset(prime, true, sizeof(prime));
    prime[0] = prime[1] = false;
    for(int r = 2; r * r <= MAX_N; r++) {
        if(prime[r]) {
            table[p++] = r;
            for(int c = r * 2; c <= MAX_N; c+= r) {
                prime[c] = false;
            }
        }
    }
}


int main(void) {
    initialize();
    int num;
    while(cin >> num) {
        int cnt = 0;
        for(int r = 0; table[r] <= num; r++) cnt++;
        cout << cnt << endl;
    }
    return(0);
}