using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static readonly long Mod = 1000000000 + 7;

        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var N = ReadLine()[0];
            var ai = Sarray();
            var koubai = 1L;
            foreach (var a in ai)
                koubai = lcm(koubai, a);
            var ans = 0L;
            foreach (var ad in ai)
                ans += (koubai - 1) % ad;

            WriteLine(ans);

            //Out.Flush();
        }
        static long gcd(long x, long y) => y == 0 ? x : gcd(y, x % y);
        static long lcm(long x, long y) => x * y / gcd(x, y);
    }
}