#include int main(void){ int N; scanf("%d%*d",&N); int k=N-1; while(k>1){ if(N%k==0) break; k--; } printf("%d\n",k); return 0; }