#include<iostream>
using namespace std ;

int main()
{int c,g;
	bool prime[30] ;
	for(int i = 0 ; i <=30 ; i++ )
	prime[i] = true ;
	prime[0] = prime[1] = false ;
	for(int i = 2 ; i <=30 ; i++){
		if(prime[i]){
					for(int j = i * i ; j <=30 ; j += i )
					prime[j] = false ;
		}
	}


while(cin>>g){
	c=0;

	for(int i = 0 ; i <= g ; i++){
		if(prime[i])
		c++;
	}
cout<<c<<endl;
}
}