#include using namespace std; #define REP(i,a,b) for(i=a;i'9')break;*x=(*x)*10+k-'0';}if(m)(*x)=-(*x);} template void reader(T *x, S *y){reader(x);reader(y);} void writer(int x, char c){int s=0,m=0;char f[10];if(x<0)m=1,x=-x;while(x)f[s++]=x%10,x/=10;if(!s)f[s++]=0;if(m)mypc('-');while(s--)mypc(f[s]+'0');mypc(c);} template void writerLn(T x){writer(x,'\n');} template T GCD(T a,T b){T r; while(a){r=b; b=a; a=r%a;} return b;} int main(){ int i, k; int N, K; int res = 1; reader(&N,&K); REP(i,1,N){ k = GCD(i, N-i); res = max(res, k); } writerLn(res); return 0; }