import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long N = sc.nextLong(); long min_value = N; for(long i = 2; i * i <= N; i++){ if(N % i == 0){ if(i == 2){ if(N / i > 2){ min_value = Math.min(min_value, N / i); } }else{ min_value = Math.min(min_value, (Math.min(i, N / i))); } } } System.out.println(min_value); } }