from functools import lru_cache p, c = map(int, input().split()) @lru_cache(None) def dfs(i, x): if i == p + c: return x ret = 0 if i < p: for a in [2, 3, 5, 7, 11, 13]: ret += dfs(i + 1, x * a / 6) else: for a in [4, 6, 8, 9, 10, 12]: ret += dfs(i + 1, x * a / 6) return ret print(dfs(0, 1))