#include<bits/stdc++.h>
using namespace std;
bool pr[1000005];
int a[1000005] = {0, 0};
int main()
{
    memset(pr, true, sizeof(pr));
    for (int i = 2; i < 1000; i++)
        if (pr[i])
            for (int j = i * 2; j < 1000000; j += i)
                pr[j] = false;
    for (int i = 2; i < 1000000; i++)
        if (pr[i])
            a[i] = a[i - 1] + 1;
        else
            a[i] = a[i - 1];
    int n;
    while (~scanf("%d", &n))
        printf("%d\n", a[n]);
    return 0;
}


