n = int(raw_input())vis = [False for_ in xrange(n+1)]p, q = [], []for i in xrange(2, n+1):if vis[i]:continuep.append(i)for j in xrange(i+i, n+1, i):vis[j]=Truefor i in p:cc, tmp=1, iwhile tmp <= n:cc += 1tmp *= iq.append(cc-1)lb, ub = n, n*nwhile ub - lb > 1:mid = (lb + ub) / 2flag = Truefor (i, j) in zip(p, q):if mid < 2 * (i**j):flag = Falsebreakif flag:ub = midelse:lb = midprint ub