N = int(input()) print([1051, 10275, 841341][N - 1])