import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] s = new String[3]; for(int i = 0; i < 3; i++) { s[i] = sc.next(); } sc.close(); int[] k = new int[3]; for(int i = 0; i < 3; i++) { if(s[i].equals("NONE")) { k[i] = 16; }else { k[i] = 16 - (s[i].length() + 1)/ 2; } } long ans = 1; for(int i = 0; i < 3; i++) { ans *= (long)Math.pow(k[i], 2); } System.out.println(ans); } }