#include <iostream>
#include<math.h>
using namespace std;

//2,3,5????????°????¨?????????????????????????????¨??????????????????¨??????


int main(void){

	int n,count_num,count_pnum;

	while (cin >> n){
		count_num = 0;
		for (int i = 2; i < n+1; i++){
		
			//2,3,5?????¨????????????
			if (i == 2 || i == 3 || i == 5){ count_num++; }

			if (i % 2 != 0 && i % 3 != 0 && i % 5 != 0){
			//2,3,5??§?????????????????¨???????´???°??§??????????????§?¨?????????????
				count_pnum = 0;
				for (int j = 7; j < i; j++){
					if (i%j != 0)count_pnum++;
				}if (count_pnum == i - 7)count_num++;


			}
		}cout << count_num << endl;
	}
	return 0;
}