using System; using static System.Console; using System.Linq; using System.Collections.Generic; using System.Runtime.Intrinsics.Arm; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var r = ReadLine(); var g = ReadLine(); var b = ReadLine(); var len = new int[] { 0, 15, 0, 14, 16, 13, 0, 12, 0, 11, 0, 10, 0, 9, 0, 8, 0, 7, 0, 6, 0, 5, 0, 4, 0, 3, 0, 2, 0, 1, 0, 0}; WriteLine(1L * len[r.Length] * len[r.Length] * len[g.Length] * len[g.Length] * len[b.Length] * len[b.Length]); } }