using System; using System.Text; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Runtime.Serialization.Formatters; using static System.Console; using static System.Math; namespace YukiCoder { public class Program { public static void Main(string[] args) { new Program().Solve(); } public void Solve() { string R = ReadLine(); string G = ReadLine(); string B = ReadLine(); long r, g, b; WriteLine(CalcRGB(R) * CalcRGB(G) * CalcRGB(B)); } public static double CalcRGB(string R) { double n = 0; if (R.Contains(",")) { n = 15 - CountOf(R, ","); } else { n = 15; if (R == "NONE") { n = 16; } } return Pow(n,2); } /// /// 指定した文字列がいくつあるか /// public static int CountOf(string target, params string[] strArray){ int count = 0; foreach (string str in strArray) { int index = target.IndexOf (str, 0); while (index != -1) { count++; index = target.IndexOf (str, index + str.Length); } } return count; } } }