X = 1 for _ in range(3): Y = input() Z = [16, 16 - len(Y.split(','))][Y != 'NONE'] X *= Z**2 print(X)