import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { static final int IMPOSSIBLE = -1; static public void main(String[]args) throws Exception { Scanner sc = new Scanner(System.in); List list = new ArrayList<>(); for(int i = 0; i < 3; i++) { String s = sc.next(); list.add(count(s)); } pirntAns(list); } static int count(String s) throws Exception { final String NONE = "NONE"; if(NONE.equals(s)) return 16; final String SEPARATOR = ","; String [] arr = s.split(SEPARATOR); return 16 - arr.length; } static void pirntAns(List list) throws Exception { long ans = 1; for(int tmp : list) { ans *= pow(tmp, 2); } System.out.println(ans); } static long pow(long l, double p) throws Exception { return (long) (Math.pow(l, p)); } }