using System; using System.Linq; using System.Collections.Generic; using System.IO; class MyClass { public static void Solve() { var N = int.Parse(Console.ReadLine()); var P = Console.ReadLine().Split().ToArray(); var Q = P.Select(x => x.ToCharArray().Select(y => int.Parse(y.ToString())).Sum()); var prod = 1; foreach (var item in Q) { prod *= item; } Console.WriteLine(prod.ToString().ToCharArray().Select(y => int.Parse(y.ToString())).Sum()); } public static void Main() { var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Console.SetOut(sw); Solve(); Console.Out.Flush(); } }