totalDice = int(input()) ikasamaDice = int(input()) dic = [None for i in range(10)] def getPattern(index): if index >= totalDice - 1: return dict([(i + 1, 1) for i in range(6)]) if dic[index] is not None: return dic[index] ans = {} ret = getPattern(index + 1) for i, j in ret.items(): for k in [l + 1 for l in range(6)]: key = i + k if key in ans.keys(): ans[key] += j else: ans[key] = j dic[index] = ans return ans ikasamaDic = [None for i in range(10)] def getIkasamaPattern(index): if index >= ikasamaDice: return getPattern(index) if index >= totalDice - 1: return dict([(i + 4, 2) for i in range(3)]) if ikasamaDic[index] is not None: return dic[index] ans = {} ret = getIkasamaPattern(index + 1) for i, j in ret.items(): for k in [(l % 3) + 4 for l in range(6)]: key = i + k if key in ans.keys(): ans[key] += j else: ans[key] = j ikasamaDic[index] = ans return ans win = 0 lose = 0 draw = 0 pattern = getPattern(0) ikasama = getIkasamaPattern(0) for i in pattern.keys(): wCount = sum([v for j, v in ikasama.items() if j < i]) lCount = sum([v for j, v in ikasama.items() if j > i]) dCount = sum([v for j, v in ikasama.items() if j == i]) win += wCount * pattern[i] lose += lCount * pattern[i] draw += dCount * pattern[i] ans = lose / (win + lose + draw) print(ans)