#include <iostream>
using namespace std;
int main() {
int a=0,n=0,s=1;
cin>>n;
while (s<=n)
{
s++;
if(s%3==2 and s%7==2 and s%11==2)
cout<<a;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgYT0wLG49MCxzPTE7CgljaW4+Pm47Cgl3aGlsZSAoczw9bikKCQoJewoJcysrOwoJCQoJaWYocyUzPT0yIGFuZCBzJTc9PTIgYW5kIHMlMTE9PTIpCgljb3V0PDxhOwoJCiAKCX0KCQoJcmV0dXJuIDA7Cn0=