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

void main(){
    readln();
    double[] inputs = readln().chomp().split().map!(to!double).array();
    solve(inputs).writeln();
}

double solve(double[] inputs){
    immutable double saishoKobaisu = inputs.reduce!((double a, double b) => a * b / gcd!double(a, b));
    return f(saishoKobaisu - 1, inputs);
}

double f(double m, double[] inputs){
    return inputs.map!((a) => m % a).sum();
}