import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int r = 16; String rstr = sc.nextLine(); if (!rstr.equals("NONE")) { r -= rstr.split(",").length; } int g = 16; String gstr = sc.nextLine(); if (!gstr.equals("NONE")) { g -= gstr.split(",").length; } int b = 16; String bstr = sc.nextLine(); if (!bstr.equals("NONE")) { b -= bstr.split(",").length; } System.out.println(r * r * g * g * b * b); } }