import java.util.Scanner;


public class Main_yukicoder312 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();

        long ret = n;
        if (n != 4 && n % 2 == 0) {
        	ret = n / 2;
        }

        for (long j = 3; j * j <= n; j++) {
        	if (n % j == 0) {
        		System.out.println(Math.min(ret, j));

        		sc.close();
        		return;
        	}
        }

		System.out.println(Math.min(ret, n));

        sc.close();
    }
}