#include <iostream>
#include <vector>
using namespace std;
vector <int> wow(1000001);

bool prime(int m){
	if(m < 2)return false;
	if(m == 2)return true;
	if(m%2 == 0)return false;

	for(int i = 3; i*i <= m; i += 2){
		if(m%i == 0)return false;
	}
		return true;
}

int main(){

	for(int i = 0; i < 1000001; ++i){
	if(prime(i)){
					wow[i] = 1;
				}else{
					wow[i] = 2;
				}
	}


	int n;
	
	while(cin >> n){
		int a=0;
		for(int i = 1; i <= n; ++i){
		if(wow[i] == 1){
				++a;
			}
	}
		cout << a << '\n';
	}
}