#include<stdio.h>
#include<iostream>
#include<cmath>

using namespace std;

int main()
{
    long int arr[999999];
    int p=0;
    int i,b,a;
    for(a=2;a<=999999;a++){

                b=0;
                for(i=2;i<=sqrt(a);i++){
                    if(a%i==0){
                    b=1;
                    break;
                    }
                }
                if(b==0){
                arr[p]=a;
                p++;
                }
            }
    int num,cot;
    while(scanf("%d",&num)!=EOF){
            cot=0;
            for(i=0;i<=999999;i++){
                if(arr[i]<=num)
                    cot++;
                else
                    break;
            }
            cout << cot << endl;
    }
    return 0;
}