#include <iostream>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stdio.h>
#include <string>
#include <string.h>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	long a[10000],co = 3;

	a[0] = 2;
	a[1] = 3;
	a[2] = 5;
	a[3] = 7;
	for (long long i = 8; i < 100000; i++)
	{
		if (i % 2 != 0 && i % 3 != 0)
		{
			if (i % 5 != 0 && i % 7 != 0)
			{
				co += 1;
				a[co] = i;
			}
		}
	}

	long long n,co2;

	while (cin >> n)
	{
		co2 = 0;
		for (long j = 0; j < co + 1; j++)
		{
			if (a[j] > n)
			{
				break;
			}
			co2 += 1;
		}

		cout << co2 << endl;
	}
}
