//কী পেয়েছো তুমি, কী চেয়েছিলে তুমি.? হিসেবটা তোমার বড়ই গড়মিল...!!//
#include <bits/stdc++.h>
using namespace std;
#define INF 0x3F3F3F3F
typedef long long ll;
vector<ll>v;
ll solve(ll n)
{
    int cnt=0;
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
        if (prime[p])
            cnt++;
   return cnt;
}
int main ()
{
    ll n;
    while((scanf("%lld",&n))!=EOF){
    cout<<solve(n)<<endl;
    }
}
/*
5 6
1 0
0 5
1 2
1 3
2 3
3 4
*/

