from sys import stdin def main(): input = lambda: stdin.readline()[:-1] N = int(input()) if N == 1: print(1) return p = [1000003, 1000033, 1000037, 1000039, 1000081, 1000099, 1000117, 1000121, 1000133, 1000151, 1000159] print(p[0] * p[N-2]) main()