import math a, b = map(int, input().split()) g = math.gcd(abs(a), abs(b)) ans = 0 for x in range(10**2): for y in range(10**2): ans += 1/(2+g*(x+y))**(2+g*(x+y)) print(ans)