import java.util.*; import java.io.*; public class Main { void solve (FastScanner in, PrintWriter out) { long ans = 0; long[] ar = new long[3]; for (int i=0; i<3; i++) { String s = in.next(); if (s.equals("NONE")) ar[i] = 16; else { ar[i] = 16 - (s.length()+1)/2; } } out.println(ar[0]*ar[0]*ar[1]*ar[1]*ar[2]*ar[2]); } public static void main(String[] args) { FastScanner in = new FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); Main main = new Main(); main.solve(in, out); in.close(); out.close(); } static class FastScanner { private InputStream in; private byte[] buffer = new byte[1024]; private int length = 0, p = 0; public FastScanner (InputStream stream) { in = stream; } public boolean hasNextByte () { if (p < length) return true; else { p = 0; try {length = in.read(buffer);} catch (Exception e) {e.printStackTrace();} if (length <= 0) return false; } return true; } public int readByte () { if (hasNextByte() == true) return buffer[p++]; return -1; } public boolean isPrintable (int n) {return 33<=n&&n<=126;} public void skip () { while (hasNextByte() && !isPrintable(buffer[p])) p++; } public boolean hasNext () {skip(); return hasNextByte();} public String next () { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int t = readByte(); while (isPrintable(t)) { sb.appendCodePoint(t); t = readByte(); } return sb.toString(); } public int nextInt () {return Math.toIntExact(nextLong());} public int[] nextIntArray (int n) { int[] ar = new int[n]; for (int i=0; i