#include <cstdio>
#include <vector>
#include <stack>
#include <iostream>
#include <string> 
#define debug	  0
#define 	MAXN		110
long long  gcd(int a,int b)
{	return (b==0)? a:gcd(b,a%b);
}
long long  lcm(int a,int b)
{	return  a/gcd(a,b) *b;
}
using namespace std;

int main()
{	
#if debug	
freopen("data.txt","r",stdin);
#endif
	int N,f = 0,num,sum = 0;
	long long d = 1;
	cin>>N;
	vector<int>bin;
	while(N--)
	{	cin>>num;
		bin.push_back(num);
		d = lcm(d,num);
		sum += num -1 ;
	}
	//cout<<d;
	d--;
	for(int i=0;i<bin.size();i++)
	{	f += d%bin[i];
	}
	cout<<sum;
	
}