#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
// have you mooed today?
bool isprime(int& num)
{
    static int c;
    static int max;
    if(num == 1) return false;
    if(num == 2) return true;
    if(num % 2 == 0) return false;
    max = ceil(sqrt(num));

    for(c=3; c < max+1; c+=2)
        if(num % c ==0) return false;
    return true;
}

int main()
{
    int ans =0;
    int c;
    int buff;
    vector<int> prime;
    for(c=1;c<=999999;c++)
    {
        if(isprime(c)) ans++;
        prime.push_back(ans);
    }
    cout << prime[0] << endl;
    while(cin >> buff)
    {
        cout << prime[buff -1] << endl;
    }
    return 0;
}