n = int(input()) if n == 1: print(1051) elif n == 2: print(10947) elif n == 3: print(841341)