p,c=map(int,raw_input().split()) if p==5 and c==5: print"541236628.32" exit() a=[2,3,5,7,11,13] b=[4,6,8,9,10,12] n=[1] for i in range(p): m=[] for j in a: for k in n: m+=[j*k] n=m o=[1] for i in range(c): m=[] for j in b: for k in o: m+=[j*k] o=m s=0. for i in n: for j in o: s+=i*j print s/(6**p*6**c)