import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); if (n == 1) { System.out.println(1); } else { int cnt = 1; for (int i = 100001; ; i++) { if (isSosuu(i)) { cnt++; if (cnt == n) { System.out.println((long) i * i); return; } } } } } static boolean isSosuu(long n) { if (n < 2) return false; if (n == 2) return true; long end = (int) Math.sqrt(n) + 1; for (int i = 2; i <= end; i++) { if (n % i == 0) { return false; } } return true; } }