#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools

pS = [2,3,5,7,11,13]
cS = [4,6,8,9,10,12]

P,C = map(int,input().split())

def dfs(P,C,k):
    ret = 0
    if P != 0:
        for p in pS:
            ret += dfs(P-1,C,k*p)
    elif C != 0:
        for c in cS:
            ret += dfs(0,C-1,k*c)
    else:
        return  k
    return ret

print(dfs(P,C,1) / ( 6**(P+C)))