import java.util.Scanner; public class Chikanshori { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner s = new Scanner(System.in); long N = s.nextLong(); s.close(); boolean tof = true; int root = (int)Math.sqrt(N); if(N % 3 != 0 &&N % 4 == 0){ N = 4; }else if(N % 2 == 0){ N /= 2; } int[] prime = new int[root+1]; prime[0] = 1; prime[1] = 1; for(int i = 3;i <=root;i++){ if(prime[i] == 0){ for(int j = 1;j*i <= root;j++){ prime[j*i] = 1; } if(N % i == 0){ System.out.println(i); tof = false; break; } } } if(tof){ System.out.println(N); } } }