stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

main()

{

    int n,i,x;

    while(~scanf("%d",&n))

    {

        int sum=0;

        for(i=0;i<n;i++) scanf("%d",&x),sum+=x-1;

        printf("%d\n",sum);

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main(){

	long long int n;

	long long int a[10100];

        long long int cnt=0;

	scanf("%lld",&n);

	for(long long int i=0;i<n;i++){

		scanf("%lld",&a[i]);

	    cnt+=a[i];

	}

	printf("%lld",cnt-n);

	return 0;

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#include<iostream>

using namespace std;

#define mn 100005

#define FLN "code"

#define endl "\n"

#define int long long

#define fi first

#define se second

#define inf 4444444444444444444

#define mod 1000000009

#define FOR(i, a, b) for (int i=a; i<(b); i++)

#define FOR0(i, a) for (int i=0; i<(a); i++)

#define FOR1(i, a) for (int i=1; i<=(a); i++)

#define codenhanh(); ios_base::sync_with_stdio(0) ,cin.tie(0),cout.tie(0);



int n,m,a[mn];

int ttl=0;

signed main()

{

	codenhanh();

	cin>>n;

	for(int i=1;i<=n;i++)

	{

		cin>>a[i];

		ttl+=a[i];

		ttl-=1;

	}

	cout<<ttl;

	

	

return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main(){

	long long int n;

	long long int a[10100];

        long long int cnt=0;

	scanf("%lld",&n);

	for(long long int i=0;i<n;i++){

		scanf("%lld",&a[i]);

	    cnt+=a[i];

	}

	printf("%lld",cnt-n);

	return 0;

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
// Enter Source:

#include <bits/stdc++.h>

#define MOD (1000000000+7)



typedef long long int lli;



using namespace std;



lli GCD(lli X, lli Y)

{

	if(X%Y == 0) return Y;

	else return GCD(Y,X%Y);

}



int main()

{

//	lli N;

//	cin >> N;

//	vector<lli> vec, ans;

//	for(lli i = 0; i < N; i++)

//	{

//		lli temp;

//		cin >> temp;

//		vec.push_back(temp);

//	}

//	

//	lli m = vec[1];

//	for(lli j = 1; j < N; j++) m = GCD(max(m,vec[j]),min(m,vec[j])); 

//	for(lli i = 1; i < N; i++)

//	{

//		lli gcd = vec[0];

//		for(int j = 0; j < N; j++)

//		{

//			if(i != j) gcd = GCD(max(gcd,vec[j]),min(gcd,vec[j]));

//			if(gcd < m) break;

//		}

//		if(gcd > m) m= gcd;

//	}

//	cout << m << endl;

	lli N, sum = 0;

	cin >> N;



	for(lli i = 0; i < N; i++)

	{

		lli temp;

		cin >> temp;

		sum += temp;

	}

	cout << sum -N << endl;

	return 0;

}




// Optimized solution to the same problem (faster):
#include<stdio.h>

int main(){

	long long int n;

	long long int a[10100];

        long long int cnt=0;

	scanf("%lld",&n);

	for(long long int i=0;i<n;i++){

		scanf("%lld",&a[i]);

	    cnt+=a[i];

	}

	printf("%lld",cnt-n);

	return 0;

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main(){

 int a;

 cin>>a;

 int sum =0,s;

 for(int i =0 ; i < a ; i++){

    cin >> s;

  sum+=s;

 }

  cout<<sum-a;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



typedef long long int ll;





int main()

{



    int n;

    cin>>n;

    long long int m;

    ll a[n];



    ll s=0;

    for(int i=0;i<n;i++)

        {

            cin>>a[i];

            s=s+a[i]-1;

        }







    cout<< s;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define mst(a,b) memset(a,b,sizeof(a))

typedef long long ll;

ll a[10000];

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

        ll sum=0;

        for(int i=0;i<=n-1;i++){

            cin>>a[i];

            sum+=a[i];

            sum--;

        }

        cout<<sum<<endl;

    }

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

using namespace std; 







int main()

{

	//freopen("D:\\patin.txt","r",stdin);

	int n;

	scanf("%d",&n);

	int sum = 0;

	int tmp;

	for(int i = 0;i < n;++i){

		scanf("%d",&tmp);

		sum += tmp-1;

	}	

	printf("%d\n",sum);

	return 0;	

} 

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main(){

	int n,m,ans=0;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>m;

		ans+=m;

	}

	cout<<ans-n;

	return 0;

} 

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main()

{

    int n, x, sum = 0;

    cin >> n;

    for(int i = 0; i < n; i++)

    {

        cin >> x;

        sum += x;

    }

    cout << sum-n << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



#define mp make_pair

#define fi first

#define se second

#define pb push_back

#define all(x) (x).begin(),(x).end()

#define f1(i, n) for(int i=1;i<=n;i++)

#define f0(i, n) for(int i=0;i<n;i++)

#define ldb ldouble

#define inf 9999999999999999

#define mod 998244353

//#define mod 1000000007

#define int ll



typedef long long ll;

typedef unsigned long long ull;

typedef double db;

typedef long double ldb;

typedef pair <int, int> pii;

typedef pair <ll, ll> pll;

typedef pair <ll, int> pli;

typedef pair <db, db> pdd;



//**Start here**//



///declaration///



//library structure//

int a[100005],b[15][15],cnt[100005];

vector <int> g[15];



//variables//

int n,m,X,Y,ans=0;



//data structure//



///function///

//preset//



//input//

void input()

{

    cin >> n;

    for (int i=1;i<=n;++i)

    {

        cin >> a[i];

        ans+=a[i]-1;

    }

    cout << ans;

    return;

}



//algorithm//



//solve//

void solve()

{



    return;

}



//output//

void output()

{



    return;

}



///main///

signed main()

{

    ios_base::sync_with_stdio(0);

    cin.tie(0);

    cout.tie(0);

	//freopen("test.INP","r",stdin);

    //freopen("test.OUT","w",stdout);

    /*int test;

    cin >> test;

    for (int k=1;k<=test;++k)*/

    {

        input();

        solve();

        output();

    }

    return 0;

}



/**code-by-@datr1bs**/


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bitset>

#include <string>

using namespace std;

int main()

{

    long long sum = 0;

    int n;

    long long num;

    cin >> n;

    for(int i = 1;i <=n;i++)

    {

        cin >> num;

        sum+=num;

    }



    cout << sum - n << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <stdio.h>

#include <string.h>

#include<iostream>

#include<stack>

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

    int n,a[3002]= {0};

    cin>>n;

    for(int i=0; i<n; i++)

    {

        cin>>a[i];

    }

    sort(a,a+n);

    long long  Max=0;

    for(int i=0; i<n; i++)

    {

        Max+=a[i];

    }

    cout<<Max-n<<endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

using namespace std;

const int maxn = 10000+10;

int a[maxn];

int gcd(int a,int b)

{

    return b==0?a:gcd(b,a%b);

}



int main()

{

    // cout<<gcd(12,8)<<endl;

    long long sum = 0;

    int n;

    cin>>n;

    for(int i=1;i<=n;i++)

    cin>>a[i],sum+=a[i];

    cout<<sum-n;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int gcd (int a, int b) {

    while (a!=0 && b!=0) {

        if (a>b) {

            a=a%b;

        }

        else b=b%a;

    }

    return a+b;

}

int a[3009];

int main()

{

    int q,i,n,j,maxx = 0 , summ = 0;

    cin >> n;

    for(i=0;i<n;i++)

    cin>>a[i];

   sort(a , a + n);

   for(i=0;i<n;i++)

   {

       summ += a[i];

   }

   summ-=n;

   cout << summ;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



#define M 1000000



bool isTrue(int val, vector<int> list) {

	

	for(int x: list) {

		if(val%x != x-1) {

			return false;

		}

	}

	return true;

}





void solve()

{	

	int n,num,m = INT_MIN,val;

	vector<int> list;

	cin >> n;

	while(n-- && cin >> num) {

		list.emplace_back(num);

		m = max(m,num);

	}

	//cout << m << endl;

	val = m-1;

	while(1) {

		if(isTrue(val, list)) {

			cout << val << endl;

			break;

		} 

		val += m;

	}

}



bool perfectSquare(long long int n) {

	double long s = sqrt(n);

	

	if(s == floor(s)) {

		return true;

	}

	return false;

}



void answer() {

	long long int len,num;

	vector<long long int> list;

	cin >> len;

	

	while(len-- && cin >> num) {

		list.emplace_back(num);

	}

	

	bool prime[M+1];

	

	memset(prime, true, sizeof(prime));

	

	for(int i=2;i<=sqrt(M);i++) {

		if(prime[i]) {

			for(int j=i*i;j<=M;j+=i) {

				prime[j] = false;

			}

		}

	}

	

	for(long long int x: list) {

		if(perfectSquare(x)) {

			long long int p = sqrt(x);

			if(prime[p]) {

				cout << "YES" << endl;

			} else {

				cout << "NO" << endl;

			}

		} else {

			cout << "NO" << endl;

		}

	}

}



void result() {

	long long int n,res=0,num;

	cin >> n;

	while(n-- && cin >> num) {

		res += num-1;

	}

	

	cout << res << endl;

}

			

		



int main() {

	ios::sync_with_stdio(0);

	cin.tie(0);

	result();

	return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define ll long long int



using namespace std;



int main()

{

     ll n,i,j,s=0,x;

     cin>>n;

     for(i=0;i<n;i++)

     {

         cin>>x;

         s+=x;

     }

     cout<<s-n<<endl;

    return 0;

}








// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define ll long long

int main()

{

    int n,sum=0;

    cin>>n;

    int a[n+5]={0};

    for(int i=0;i<n;i++)

    {

        cin>>a[i];

        sum+=a[i];

    }

    cout<<sum-n<<endl;

    return 0;

}




// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,t=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); t+=a; }

	t-=n;

	printf("%d",t);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cstdint>

#include <vector>

#include <algorithm>



int main() {

  size_t N;

  scanf("%zu", &N);



  std::vector<intmax_t> a(N);

  for (size_t i=0; i<N; ++i)

    scanf("%jd", &a[i]);



  intmax_t f=0;

  for (size_t i=0; i<N; ++i)

    f += a[i]-1;



  printf("%jd\n", f);

}


// Optimized solution to the same problem (faster):
#include <cstdio>



int main() {

  int N;

  scanf("%d", &N);



  int res = 0;

  for (int i = 0; i < N; ++i) {

    int a;

    scanf("%d", &a);

    res += a-1;

  }

  printf("%d\n", res);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main()

{

    int a=0,b,c,d=0;

    cin>>b;

    for(int i=1;i<=b;i++)

    {

        cin>>c;

        a=a+c;

    }



    cout<<a-b;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define endl "\n"



using namespace std;



int main(){

    long long n, a, total=0;

    cin >> n;

    for(long long i=0; i<n; i++){

        cin >> a;

        total+=a;

    }

    cout << total-n <<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

 //Compiler version g++ 6.3.0



 int main()

 {

 	int num;

 	cin >> num;

 	long sum=0;

 	while(num--){

 		int x;

 		cin >> x;

 		sum+=--x;

 	}

 	cout << sum << "\n";

 }

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int n,i,max=0;

	cin>>n;

	int a[n];

	for(i=0;i<n;i++){

		cin>>a[i];

		max+=a[i]; 

	} 

	max-=n;

	cout<<max<<endl;	

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int N;



int main() {

    cin >> N;

    int a[N], sum = 0;

    for (int i = 0; i < N; i++) cin >> a[i];

    for (int k = 0; k < N; k++) {

        sum += a[k] - 1;

    }

    cout << sum << endl;

    

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#define debug 0

#define test 0

#define CPLUS 1

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <math.h>

#include <string.h>

#if CPLUS

#include <iostream>

#include <stack>

#include <string>

#include <algorithm>

#include <vector>

#include <set>

#include <iterator>

#include <queue>

#include <map>

#include <unordered_map>

#include <functional>

#include <iomanip>

using namespace std;

#endif







int main(void)

{

#if debug

	freopen("in.txt", "r", stdin);

#endif

	int n;

	cin >> n;

	long long ans = 0;

	for (int i = 0; i < n; i++) {

		int tmp;

		scanf("%d", &tmp);

		ans += (tmp - 1);

	}

	printf("%lld\n", ans);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int N;



int main()

{

	ios::sync_with_stdio(0);

	cin.tie(0);  cout.tie(0);



	cin >> N;

	int sum = 0;

	for( int i = 1; i <= N; i++) {

		int x;  cin >> x;

		sum += x-1;

	}



	cout << sum << endl;



	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main() {

  int n; cin >> n;

  int sum = 0;

  while(n--) {

    int x; cin >> x;

    sum += x - 1;

  }

  cout << sum << '\n';

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int n;

int a[3500];

int main(){

    scanf("%d",&n);

    int maximum = 0;

    for(int i = 1; i <= n; i++){

        scanf("%d",&a[i]);

        maximum += a[i] - 1;

    }

    printf("%d\n",maximum);

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

using namespace std;



int main()

{

    int n,i,sum,t;

    scanf("%d",&n);

    i=n;

    sum=0;

    while(i--){

        scanf("%d",&t);

        sum+=t;

    }

    printf("%d",sum-n);

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

int n;

cin>>n;

int a[n];

long long sum=0;

for(int i=0;i<n;i++)

{

cin>>a[i];

sum+=a[i];

}

sum-=n;

cout<<sum;

return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cstring>

#include <algorithm>

#include <vector>

#include <math.h>

#include <string.h>

#include <algorithm>

#include <iostream>

#include <string>

#include <sstream>

#include <iostream>

#include <time.h>

#include <queue>

#include <list>

#include <map>

#include <set>

#include <vector>

#include <stack>

#include <string.h>

#include <bitset>

#define sf scanf

#define pf printf

#define lf double

#define p123 printf("123\n");

#define pn printf("\n");

#define pk printf(" ");

#define p(n) printf("%d",n);

#define pln(n) printf("%d\n",n);

#define s(n) scanf("%d",&n);

#define ss(n) scanf("%s",n);

#define ps(n) printf("%s",n);

#define sld(n) scanf("%lld",&n);

#define pld(n) printf("%lld",n);

#define slf(n) scanf("%lf",&n);

#define plf(n) printf("%lf",n);

#define sc(n) scanf("%c",&n);

#define pc(n) printf("%c",n);

#define gc getchar();

#define ll long long

#define re(n,a) memset(n,a,sizeof(n));

#define len(a) strlen(a)

#define eps 1e-7

#define zero(x) (((x) > 0? (x):(-x)) < eps)

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <vector>

#include <math.h>

#include <string.h>

#include <algorithm>

#include <iostream>

#include <string>

#include <sstream>

#include <iostream>

#include <time.h>

#include <queue>

#include <list>

#include <map>

#include <set>

#include <vector>

#include <stack>

#include <string.h>

#include <bitset>



using namespace std;

//https://codeforces.com/contest/1238/problems

//https://codeforces.com/contest/1238/submit

ll a[100000];

int main(){

    ll n;

    sld(n)

    ll sum = 0;

    for(int i = 0; i < n; i ++){

        sld(a[i])

        sum += a[i] -1;

    }

    pld(sum) pn





    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

#include<cstring>

#include<algorithm>

#include<vector>

#include<cmath>

#include<map>

#include<set>

#include<cstdio>

#define MAXA 100000

#define MAX 20000000000

#define s(i) scanf("%d", &(i))

#define p(i) printf("%d", (i))

#define ps() printf(" ") 

#define rer(i,j,k) for((i)=(j);(i)<(k);++(i))

#define ret(i,j,k) for((i)=(j);(i)>(k);--(i))

using namespace std;





int main(){

	int i, sum = 0, m,n;

	cin >> n;

	rer(i,0,n){

		cin >> m;

		sum += (m-1);

	}

	cout << sum << endl;

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int i,n,sum,k;

	sum=0;

	scanf("%d",&n);

	for(i=0;i<n;i++)

	{

		scanf("%d",&k);

		sum+=(k-1);

	}

	printf("%d",sum);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <vector>

#include <algorithm>

#include <stdio.h>

#include <queue>

#include <iostream>

using namespace std;

#define min(a,b) (a>b?b:a)

int main(){

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	int n,temp;

	cin>>n;

	int sum=0;

	for(int i=0;i<n;i++){

		cin>>temp;

		sum+=temp-1;

	}

	cout<<sum<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

 long long int a,b,c,d,i,e;

    e=0;

cin>>a;

for(i=1;i<=a;i++)

{

cin>>b;

b--;

e+=b;

}

cout<<e<<endl;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int i,n,s=0;

	scanf("%d",&n);

	int a;

	for(i=0;i<n;i++) { scanf("%d",&a); s+=a; }

	s-=n;

	printf("%d",s);

}

// Fastest known solution for this problem: