R = input() G = input() B = input() Rv = 16-(len(R)+1)//2 if R != 'None' else 16 Gv = 16-(len(G)+1)//2 if G != 'None' else 16 Bv = 16-(len(B)+1)//2 if B != 'None' else 16 print((Rv*Gv*Bv)**2)