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