#include <bits/stdc++.h>
using namespace std;
int main(){
int n,h,s;
cin>>n;
h=n*1000+n;
{
s=h/7/11/13;
}
cout<<s<<endl;
}
/**************************************************************
Problem: 1961
User: xiaojingxuan
Language: C++
Result: Accepted
Time:8 ms
Memory:2072 kb
****************************************************************/