from math import gcd A, B = map(int, input().split()) ans = 0 if abs(A)==abs(B): for i in range(1,21,abs(A)): ans += 1/pow(i+i,i+i) else: g = gcd(A,B) for i in range(1,21,g): for j in range(1,21,g): ans += 1/pow(i+j,i+j) print(ans)