import sys if sys.platform =='ios': import clipboard a=clipboard.get() a = a.split('\n') text = '\n'.join(a) with open('input_file.txt','w') as f: f.write(text) sys.stdin = open('input_file.txt') p,q = map(int,input().split()) #pは1/pで来る #qはq分後に確実に来る dp = [0]*(q+1) dp[q] = 1 for i in range(1,q+1): dp[i] += i/p +dp[i-1] if dp[i] >= 1: exit(print(min(p,q)))