#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int i, r = 0, n, t,
a[] = {1, 2, 4, 6, 8, 9, 11, 13, 14, 16, 18, 20, 21, 23, 25, 26, 28, 30};
while (n)
{
t = n & 0x1f;
for ( i = 0; i < 18 && a[i] != t; ++i);
if (i != 18)
r += 10;
n >>= 5;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHRpbWUuaD4KCmludCBtYWluKCkKewogICAgaW50IGksIHIgPSAwLCBuLCB0LAogICAgICAgICAgIGFbXSA9IHsxLCAyLCA0LCA2LCA4LCA5LCAxMSwgMTMsIDE0LCAxNiwgMTgsIDIwLCAyMSwgMjMsIDI1LCAyNiwgMjgsIDMwfTsKCiAgICBzcmFuZCh0aW1lKE5VTEwpKTsKICAgIG4gPSByYW5kKCkgJSAxMDAwMDAwOwogICAgcHJpbnRmKCLkubHmlbDvvIgxMOmAsuaVsO+8iSVkXG4iLCBuKTsKICAgIHdoaWxlIChuKQogICAgewogICAgICAgIHQgPSBuICYgMHgxZjsKICAgICAgICBmb3IgKCBpID0gMDsgaSA8IDE4ICYmIGFbaV0gIT0gdDsgKytpKTsKICAgICAgICBpZiAoaSAhPSAxOCkKICAgICAgICAgICAgciArPSAxMDsKICAgICAgICBuID4+PSA1OwogICAgfQogICAgcHJpbnRmKCLntZDmnpwgPSAlIGRcbiIsIHIpOwoKICAgIHJldHVybiAwOwp9Cg==