import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.Map.Entry; import java.util.Scanner; import java.util.TreeMap; public class Main { static int[] primeGap = new int[] {16, 28, 52, 84}; static int[] factorCount = new int[] {24,24,4,16,80,12,32,16,24,12,96,8,32,4,96,2,48,16,4,80,24,16,16,8,48,32,8,2,48,8,16,16,12,4,48,8,60,24,8,8,48,4,8,16,16,4,64,8,12,32,8,2,160,4,96,12,12,4,64,6,8,16,16,24,72,4,8,16,10,16,32,16,12,16,8,4,64,32,16,32,48,8,12,2,192,4,8,8,48,16,4,24,16,8,32,6,24,32,16,4}; void solveTestcase(final Scanner in, final PrintWriter out) { int n = in.nextInt(); for (int i = 1, j = 0; ; i++) { if (factorCount(i) == 4) { // dump(++j, i); if (++j == n) { out.println(i); return; } } } } void solve() { try (final PrintWriter out = new PrintWriter(System.out)) { try (final Scanner in = new Scanner(System.in)) { // int t = in.nextInt(); int t = 1; while (t-- > 0) { solveTestcase(in, out); } } } } public static void main(String[] args) { new Main().solve(); } // [l,r] boolean[] segmentSieve(long l, long r) { boolean[] res = new boolean[(int)(r-l+1)]; boolean[] small = new boolean[(int)Math.sqrt(r)+1]; Arrays.fill(res, true); Arrays.fill(small, true); if(l <= 1) res[0] = false; if(l <= 0) res[1] = false; for(int i = 2; (long)i*i <= r; i++) { if(small[i]) { if((long)i*i < small.length) { for(int j = i*i; j < small.length; j += i) { small[j] = false; } } { long v = (l + i - 1) / i * i; int j = (int)((v == i ? v + i : v) - l); for(; j < res.length; j += i) { res[j] = false; } } } } return res; } private static int factorCount(long t) { int res = 1; for(int i = 2; (long)i*i <= t; i++) { int cnt = 1; while(t % i == 0) { t /= i; cnt++; } res *= cnt; } if(t != 1) { res *= 2; } return res; } static void dump(Object...objects) { System.err.println(Arrays.deepToString(objects)); } }