l = {} for i = 1, 3, 1 do s = io.read() if(s == "NONE") then l[i] = 16 else c = 15 for w in string.gmatch(s, ",") do c = c - 1 end l[i] = c end end io.write((l[1]*l[2]*l[3])^2) io.write("\n")