def solve(): ans = 1 for _ in range(3): c = input() if c == "NONE": ans *= 16 ** 2 else: ans *= (15 - c.count(',')) ** 2 print(ans) solve()