import java.util.Scanner; public class Yukicoder300 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long x = sc.nextLong(), y = 1, z = 1; for (z = 1; z < x; z++) { if ((z * z % x) == 0) break; } System.out.println(z * z / x); } }