#include<iostream>
using namespace std;

int main(){
	int x,i,j,a=1,b;
	while(1){
		try{
		cin >> x;
		if(x < 1) throw 1;
		}catch(int){
			break;
		}
		for(i=2;i<=x;i++){
			for(j=2;j<i;j++){
				if(i%j==0) a=0;
			}
			if(a==1)b++;
			a = 1;
		}
		cout << b << endl;
		b = 0;
	}
}