from sys import stdin def main(): input = lambda: stdin.readline()[:-1] N = int(input()) if N == 1: print(1) return p = [100003, 100019, 100043, 100049, 100057, 100069, 100103, 100109, 100129] print(p[0] * p[N-2]) main()