#include typedef long long ll; using namespace std; int INF = 1e9; int MOD = 1e9+7; main(){ int A,B,max = 1; cin >> A >> B; for(int i = B;i <= A;i++){ if(A % i == 0){ max = A / i; break; } } cout << max << endl; }