N = int(input()) m = 10**5 ans = 0 N -= 1 l = [] if N == 0: ans = 1 else: for i in range(1,11): for j in range(1,11): l.append((m+i)*(m+j)) l.sort() ans = l[N] print(ans)