N = int(input()) if N == 1: # 527 # 814 #1341 print(1051) elif N == 2: print(10275) else: print(841341)