#include<bits/stdc++.h>
using namespace std;
int main(){
	int a=1,n,d=0;
	cin>>n;
	while(n>=a){
		if(a%3==2 && a%5==3 && a%7==2)
			d+=1;
		a+=1;

	    
	
	}
	if(d==0)
		cout<<"0";
	else
		cout<<d;	
	return 0;
}
/**************************************************************
	Problem: 1055
	User: cyp
	Language: C++
	Result: Accepted
	Time:7 ms
	Memory:2072 kb
****************************************************************/