a, b = read_line.split.map &.to_i ans = 0.0 count = 6 ** (a + b) [2, 3, 5, 7, 11, 13].each_repeated_permutation(a) do |x| [4, 6, 8, 9, 10, 12].each_repeated_permutation(b) do |y| ans += x.reduce(1i64) { |acc, v| acc * v } * y.reduce(1i64) { |acc, v| acc * v } / count end end puts ans