import java.util.*; import java.io.*; public class Exercise75{ public static void main (String[] args) throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String nStr = new String(in.readLine()); long nd = Long.parseLong(nStr); long n = nd; long[] factor = new long[20]; int count = 0; for (long i = 3; i * i <= n; i ++){ if(n % i == 0){ while (n % i == 0){ factor[count] = i; n /= i; } count++; } } if (factor[0] > 2){ System.out.println(factor[0]); }else{ if(n % 2 == 0 && n / 2 != 2){ System.out.println(n / 2); }else{ System.out.println(n); } } } }