using System; using System.IO; using System.Linq; using System.Collections; using System.Collections.Generic; using System.Numerics; using System.Diagnostics; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using static System.Math; using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions; using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute; static class P { static void Main() { int n = int.Parse(Console.ReadLine()); try { var abc = Enumerable.Repeat(0, n).Select(_ => long.Parse(Console.ReadLine())).OrderBy(x => x).ToArray(); Console.WriteLine(abc.Sum() - abc[1]); } catch { Console.WriteLine(@"""assert"""); } } }