import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int i = 2;// 用来除的数,检验n是否为质数
for(;i<=n;i++) {
if(n%i==0) break;
}
System.out.println(n/i);
sc.close();
}
}