import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.numeric;
import std.stdio;
import std.string;

void main()
{
    long n = readln.chomp.to!long;
    long[] a = readln.chomp.split(" ").to!(long[]);

    long minE = long.max;
    long m = 1;

    foreach (x; a)
    {
        minE = min(minE, x);
        m *= x;
    }

    m -= 1;

    long mod;
    foreach (x; a)
    {
        mod += m % x;
    }
    writeln(mod);
}
