#include <iostream>
#include <complex>
using namespace std;

int main(){
    int ans,n;
	while(1){
		ans=0;
		if(scanf("%d",&n)==EOF)break;
		if(n==1){
			cout<<0<<endl;
		}else{
			if(n>=2)ans++;
			if(n>=3)ans++;
			if(n>=5)ans++;
			if(n>=7)ans++;
			if(n>=9){
				for(int i=9;i<=n;i+=2){
			        int prime=1;
				    for(int k=3;k<=sqrt(i);k+=2){
					    if(i%k==0){
						    prime=0;
						    break;
    					}
					}
				    if(prime)ans++;
				}
			}
		cout<<ans<<endl;
		}
	}
}
