import math N,K = map(int,input().split()) ans = 1 for i in range(2,N): a = i b = N-i ans = max(ans,math.gcd(a,b)) print(ans)