n = int(raw_input()) m = int(raw_input()) x = [[0 for _ in range(n*6+1)] for _ in range(n+1)] x[0][0] = 1 for i in range(n): for j in range((n-1)*6+1): if i < m: for k in range(4,7): x[i+1][j+k] += x[i][j] * 2 else: for k in range(1,7): x[i+1][j+k] += x[i][j] y = [[0 for _ in range(n*6+1)] for _ in range(n+1)] y[0][0] = 1 for i in range(n): for j in range((n-1)*6+1): for k in range(1,7): y[i+1][j+k] += y[i][j] s = 0 for i in range(n*6+1): s += y[n][i] * sum(x[n][i+1:]) print float(s) / float(6**(2*n))