#include<iostream>
using namespace std;

int Prime_number(int n){
	int i = 2;
	int ans = 0;

	while(n >= 2){
		while(1){
			if(i == n){
				ans++;
				break;
			}else if(n % i == 0){
				break;
			}
				i++;
		}
		if(n % 2 == 0)
			n--;
		else
			n -= 2;
		i = 2;
	}

	return ans;
}

int main(){
	int n;

	while(cin >> n){
		if(n == 1){
			cout << "0" << endl;
		}else if(n == 2){
			cout << "1" << endl;
		}else{
		cout << Prime_number(n) << endl;
		}
	}

}