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

/**************************************************************
	Problem: 1055
	User: sucongyi
	Language: C++
	Result: Wrong Answer
****************************************************************/