#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int n,m,j,i,s;
	bool yes;
	while(cin>>n)
	{
		s=0;
		for(i=2;i<=n;i++)
		{
			if(i==2||i==3||i==5||i==7)s++;
			else if(i%2!=0&&i%3!=0&&i%5!=0&&i%7!=0)s++;
		}
		cout<<s<<endl;
	}
	return 0;
}