using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    {
        static int[] hs;
        static long ans;
        static void Main(string[] args)
        {
            int n = int.Parse(ReadLine());
            int[] s = ReadLine().Split(' ').Select(int.Parse).ToArray();
            long hoge = Lcm(s[0],s[1]);
            for (int i = 2; i < n; i++)
            {
                hoge = Lcm(hoge, s[i]);
            }

            hoge--;
            long ans = 0;
            for (int i = 0; i < n; i++)
            {
                ans += hoge % s[i];
            }
            WriteLine(ans);
        }

        /*
         * Gcd (Gross Common Dividing) 最大公約数
         * 
        */
        static long Gcd(long a, long b)
        {
            var v = new[] { a, b };
            while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
            return v[0];
        }

        /*
         * Lcm (Last Common Multiple) 最小公倍数 
         * Gcdライブラリの仕様が前提
        */

        static long Lcm(long a, long b)
        {
            return a / Gcd(a, b) * b;
        }
    }
}

