#include <iostream>

int main(void){
	int num;
	while(std::cin >> num){
		int count = 1;
		int Prime_C = 2; //2,3
		while((6*count+1) <= num){
			++count;
		}
		Prime_C += 2*(count-1);
		if ((6*count-1) <= num){
			++Prime_C;
		}
		if (num == 2){
			Prime_C = 1;
		}
		std::cout << Prime_C << std::endl;
	}
	return 0;
}