using System;
using System.Collections.Generic;
using System.Linq;

namespace abc103_c
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = long.Parse(Console.ReadLine());
            var al = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
            var al2 = new List<long>();

            for (int i = 0; i < N; i++)
                al2.Add(al[i]);

            while(al2.Count != 1) 
            {
                var lcm = Lcm(al2[0], al2[1]);
                al2.RemoveAt(0);
                al2.RemoveAt(0);
                al2.Insert(0, lcm);
            }

            long r = 0;

            for (int i = 0; i < N; i++)
                r += (al2[0] - 1) % al[i];

            Console.WriteLine(r);
        }


        /// <summary>
        /// 最小公倍数
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static long Lcm(long a, long b)
        {
            return a / Gcd(a, b) * b;
        }

        /// <summary>
        /// 互いに素
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static bool Coprime(long a, long b)
        {
            return Gcd(a, b) == 1;
        }

        /// <summary>
        /// 最小公約数：ユークリッドの互除法 
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static long Gcd(long a, long b)
        {
            if (a < b)
                // 引数を入替えて自分を呼び出す
                return Gcd(b, a);
            while (b != 0)
            {
                var remainder = a % b;
                a = b;
                b = remainder;
            }
            return a;
        }

    }
}
