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; while(n % 2 == 0){ n /= 2; } if(n == 1){ System.out.println(nd); return; } for (long i = 3; i * i <= n; i += 2){ if(n % i == 0){ System.out.println(i); return; } } System.out.println(n); } }