P,C = map(int,input().split()) sosu = [2,3,5,7,11,13] gose = [4,6,8,9,10,12] dic1 = {} if P > 0: dic1[1] = 1 for i in range(P): next = {} for ind,val in dic1.items(): for j in sosu: if ind*j in next: next[ind*j] += val/6 else: next[ind*j] = val/6 dic1 = next.copy() dic2 = {} if C > 0: dic2[1] = 1 for i in range(C): next = {} for ind,val in dic2.items(): for j in gose: if ind*j in next: next[ind*j] += val/6 else: next[ind*j] = val/6 dic2 = next.copy() ans = 0 if len(dic1) and len(dic2): for ind,val in dic1.items(): for ind2,val2 in dic2.items(): ans += ind*ind2*val*val2 elif len(dic1) and not len(dic2): for ind,val in dic1.items(): ans += ind*val elif not len(dic1) and len(dic2): for ind,val in dic2.items(): ans += ind*val print(ans)