x = 1 for _ in range(3): y = input().split(',') if y != ['NONE']: z = 16 - len(y) else: z = 16 x *= z**2 print(x)