import java.io.*; import java.util.Scanner; public class Main_yukicoder785 { private static Scanner sc; private static Printer pr; private static void solve() { String R = sc.next(); String G = sc.next(); String B = sc.next(); int nR = (R.length() + 1) / 2; int nG = (G.length() + 1) / 2; int nB = (B.length() + 1) / 2; int r = R.length() == 4 ? 256 : 256 - 16 * nR - nR * (16 - nR); int g = G.length() == 4 ? 256 : 256 - 16 * nG - nG * (16 - nG); int b = B.length() == 4 ? 256 : 256 - 16 * nB - nB * (16 - nB); pr.println(r * g * b); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }