import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(), i; sc.close(); for (i = 2; i < N; ++i) { if (N % i == 0) break; } System.out.print(N / i); } }