#include <iostream>
using namespace std;

int main(void) {
    int* array;
    int n, count;
    
    while(cin >> n) {
        array = new int[n + 1];
        count = 0;

        for(int i = 0; i <= n; ++i) {
            array[i] = 0;
        }
        for(int i = 2; i <= n; ++i) {
//iの倍数に全て印をつける。
            if(array[i] == 0) {
                for(int j = i; j <= n; j += i) {
                    array[j] = 1;
                }
                count++;
            }
        }
        cout << count << endl;
        delete[] array;
    }
}
