#include <iostream>
using namespace std;
#define MAX 1000000


int main(){
	bool work[MAX + 1];
	int num, ans = 0;

	// 初期化
	for(int i = 6; i <= MAX; i++){
		for(int j = 2; j < (i / 2); j++){
			if (i % j == 0){
				work[i] = false;
				break;
			}else{
				work[i] = true;
			}
		}
	}
	work[0] = false;
	work[1] = false;
	work[2] = true;
	work[3] = true;
	work[4] = false;
	work[5] = true;

	// 出力
	while(cin >> num){		
		for(int i = 0; i <= num; i++){
			if(work[i] == true){
				ans++;
			}
		}
		cout << ans << endl;
	}
}