import java.util.Scanner; public class Yuki136{ public static void main(String[] arg){ Scanner sc = new Scanner(System.in); int n,k,res=1; n = sc.nextInt(); k = sc.nextInt(); if(n % 2 == 0){ res = n /2; }else{ for(int i = 3;i < n ;i++){ if(n % i == 0){ res = n /i; break; } } } System.out.println(res); } }