def main(): '''r,g,b''' c = [[0],[0],[0]] for i in range(3): x = input() if x =='NONE': c[i] =256 else: tmp = 16 -len(x.split(',')) c[i] = tmp * tmp res =1 for i in c: res*=i print(res) main()