#include <iostream>
#include<stdio.h>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define MAX 1000000

bool is_prime[MAX];
ll prime[MAX];

ll found(ll a)
{
    ll p=0;
    for(ll i=0;i<=a;i++)
    {
        is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2;i<=a;i++)
    {
        if(is_prime[i])
        {
            prime[p++]=i;
            for(ll k=2*i;k<=a;k=k+i)
            {
                is_prime[k]=false;
            }
        }
    }
    return p;
}

int main()
{
    ll n;
    while(cin>>n)
    {
        ll q;
        q=found(n);
        cout<<q<<endl;
    }
    return 0;
}

