s = """1 8 2 16 3 24 4 32 5 40 6 48 7 392 8 400 9 408 10 416 11 424 12 432 13 440 14 784 15 792 16 800 17 808 18 816 19 824 20 832 21 1176 22 1184 23 1192 24 1200 25 1208 26 1216 27 1224 28 1568 29 1576 30 1584 31 1592 32 1600 33 1608 34 1616 35 1960 36 1968 37 1976 38 1984 39 1992 40 2000 41 2008 42 2352""" dct = {} for ss in s.split('\n'): a, b = ss.split() dct[a] = b inp = input() if inp in dct: print(dct[inp]) else: hoge = 1/0