from itertools import combinations N = int(input()) candi = [0, 1] material = [100003, 100019, 100043, 100049, 100057] for a, b in combinations(material, 2): candi.append(a*b) ans = candi[N] print(ans)