from itertools import product, combinations, permutations, groupby, accumulate P, C = map(int, input().split()) sosu = [2, 3, 5, 7, 11, 13] gose = [4, 6, 8, 9, 10, 12] total = 0 for pat1 in product([i for i in range(6)], repeat=P): # P個の 0-5 の数字 a = 1 for num in pat1: a *= sosu[num] for pat2 in product([i for i in range(6)], repeat=C): b = a for num in pat2: b *= gose[num] total += b ans = total/6**(P + C) print(ans)