#include <cstdio>
#include <algorithm>

using namespace std;

const int a[] = {1, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139, 143, 149, 151, 157, 163, 167, 169, 173, 179, 181, 187, 191, 193, 197, 199, 209};

int func(int v)
{
	int b = v / 210;
	int c = -1;

	int left=0, right=48;
	do{
		int mid = (left+right)/2;
		if(a[mid] == v-b*210){
			c = mid;
			break;
		}else if(a[mid] < v-b*210)
			left = mid + 1;
		else
			right = mid - 1;
	}while(left<=right);

	return c == -1 ? -1 : b*48 + c;
}

int main(void)
{
	unsigned char* eratos = new unsigned char[28572000];
	fill(eratos, eratos+28572000, 0);
	eratos[0] = 1;

	int cnt = 4;
	int i, j, k, n;
	scanf("%d", &n);
	if(n==1) cnt = 0;
	else if(n==2) cnt = 1;
	else if(n<=4) cnt = 2;
	else if(n<=6) cnt = 3;
	else{
		for(i=0; i*210<n; ++i){
			for(j=0; j<48; ++j){
				int v = i*210 + a[j];
				int pos;
				if(v>n)
					break;
				pos = func(v);
				if(!((eratos[pos/8]>>(pos%8))&1)){
					++cnt;
					for(k=v*2; k<=n; k+=v){
						int p = func(k);
						if(p != -1)
							eratos[p/8] |= 1<<(p%8); 
					}
				}
			}
		}
	}

	printf("%d\n", cnt);
	delete[] eratos;

	return 0;
}