using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();
            var tmpLcm = A[0];
            for (var i = 1; i < N; i++) tmpLcm = Lcm(tmpLcm, A[i]);
            tmpLcm--;
            var ans = 0L;
            for (var i = 0; i < N; i++) ans += tmpLcm % A[i];

            Console.WriteLine(ans);
        }

        public static long Gcd(long a,long b)
        {
            if (b == 0) return a;

            return Gcd(b, a % b);            
        }

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