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

using namespace std;

int main()
{
    int num;
    while(scanf("%d",&num)<=30){

            int a,b;
            int cot=0;
            for(a=2;a<=num;a++){

                b=0;
                for(int i=2;i<=sqrt(a);i++){
                    if(a%i==0){
                    b=1;
                    break;
                    }
                }
                if(b==0)
                cot++;
            }
            cout << cot << endl;
    }
    return 0;
}