N = int(input()) K = int(input()) C = 6 * N dp = [0] * (C + 1) dp[0] = 1 dp2 = [0] * (C + 1) dp2[0] = 1 for _ in range(N): nx = [0] * (C + 1) for i in range(C+1): if dp[i]: for j in range(1,7): nx[i+j] += dp[i] / 6 dp = nx for _ in range(K): nx = [0] * (C + 1) for i in range(C + 1): if dp2[i]: for j in range(4,7): nx[i + j] += dp2[i] / 3 dp2 = nx for _ in range(N - K): nx = [0] * (C + 1) for i in range(C+1): if dp2[i]: for j in range(1,7): nx[i+j] += dp2[i] / 6 dp2 = nx ans = 0 _sum = 0 for i in range(1,C+1): ans += dp2[i] * _sum _sum += dp[i] print(ans)