#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <time.h>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iomanip>

#define out freopen("output.txt", "w", stdout);
#define in freopen("input.txt", "r", stdin);
#define clr(arr, key) memset(arr, key, sizeof arr)
#define pub push_back
#define pob pop_back
#define infinity 2147483647
#define LL long long
#define Pi acos(-1)
#define SZ 1000010

///int col[8] = {0, 1, 1, 1, 0, -1, -1, -1};
///int row[8] = {1, 1, 0, -1, -1, -1, 0, 1};
///int col[4] = {1, 0, -1, 0};
///int row[4] = {0, 1, 0, -1};

using namespace std;
bool primes[1100000];
int sieve(int n)
{
    int i, j;
    primes[1] = 1;
    for(i = 4; i <= 1100000; i += 2)
        primes[i] = 1;
    for(i = 3; i < 1100000 / i; i += 2)
    {
        if(primes[i] != 1)
        {
            for(j = 2; j * i < 1100000; j++)
                primes[i * j] = 1;
        }
    }
    int cnt = 0;
    for(i = 2; i <= n; i++)
        cnt += !primes[i];
    return cnt;
}

int main()
{
    int n;
    cin >> n;
    cout << sieve(n) << endl;
    return 0;
}