stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.178523677718084x):
#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);

}
// Slower C++ solution:
#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);

}


// Faster C++ solution for the same problem (measured speedup: 5.177227045890924x):
#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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.235733679199502x):
#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);

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.220282072438459x):
#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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.24627796687442x):
#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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.177344235011666x):
#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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.313189883499108x):
#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);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.240777122508349x):
#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);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

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

#define  ll  long long

#define  pi  pair<int,int>

#define  pb  push_back

#define  F   first

#define  S   second

const int N=2e5+2;

int main()

{

    ft

    ll t,i,j,n,m,s=0;

    cin>>n;

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

    {

        cin>>m;

        s+=(m-1);

    }

    cout<<s<<"\n";

    return 0;

}




// Faster C++ solution for the same problem (measured speedup: 5.314915189692316x):
#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);

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>



using namespace std;



//long long __lcm (int (*A)[3001], int N){

//    long long lcm = (*A)[0];

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

//        lcm = (((*A)[i]*lcm) / __gcd((long long)(*A)[i], lcm));

//    return lcm;

//}



int main(){

    int N; cin >> N; int A, f = 0;

    for (int i = 0; i < N; i++) {cin >> A; f += A;}

    //long long m = __lcm(&A, N)-1;

    //for (int i = 0; i < N; i++) f += m % A[i];

    cout << f-N << endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.246013608054801x):
#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);

}
// Slower C++ solution:


#include<iostream>

#include<cstdio>

#include<queue>

#include<cstring>

#include<algorithm>

#include<vector>

#include<map>

#include<sstream>

typedef long long LL;

using namespace std;

 

LL a[3010];

int main()

{

    int n;

    scanf("%d",&n);

    int s=0;

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

        scanf("%lld",&a[i]),s+=a[i]-1;

 

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

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.179802008431051x):
#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);

}
// Slower C++ solution:
#include<iostream>



using namespace std;



int main() {

	int n, ans = 0, t;

	cin >> n;

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

		cin >> t;

		ans += t - 1;

	}

	cout << ans;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.237513536519845x):
#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);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

int n, mx = 0 , mn = INT_MAX;

int sum = 0;

cin>>n;

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

    int x;

    cin>>x;

    sum += (x-1);

}

cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.246111932516649x):
#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);

}
// Slower C++ solution:
#include <cstdio>

#include <string.h>

#include <algorithm>

#include<iostream>

#include<math.h>

#include<sstream>

#include<vector>

#include<stack>

using namespace std;

#define maxn 3005

int main(){

	int n;

	cin>>n;

	int s=0;

	int a[maxn]={0};

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

		cin>>a[i];

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

        s += a[j]-1;

    cout << s<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.289121607804305x):
#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);

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

            int m;

            cin>>m;

            long long sum=0,ans=0;

            long long a[m+1],b[m+1];

            memset(b,0,sizeof(b));

            for(int j=1;j<=m;j++)

            {

                cin>>b[j];

                sum+=b[j];



            }

         //   cout<<sum<<endl;



               printf("%lld\n",sum-m);



}


// Faster C++ solution for the same problem (measured speedup: 5.309773971377705x):
#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);

}
// Slower C++ solution:
// #include<bits/stdc++.h>

#include<vector>

#include<iostream>

using namespace std;

// #pragma GCC optimize("-O3")



#ifndef ConanYu

#define CPPIO

#endif

#ifdef CPPIO

#define endl "\n"

#endif



#define push_back emplace_back

template<typename T>

class List : public vector<T>

{

public:

//  new

    template<typename... U>

    List(const U &... tail) : vector<T>(0)

    {

        pb(tail...);

    }



//  push_back

    void pb() {}

    template<typename... U>

    void pb(const T & head, const U &... tail)

    {

        this->push_back(head);

        pb(tail...);

    }



//print

    void print()

    {

        const int LEN = this->size();

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

        {

            cout << (*this)[i] << (i == LEN - 1 ? '\n' : ' ');

        }

    }

};





typedef long long ll;

typedef pair<int, int>pii;

typedef pair<long long, long long>pll;

typedef long double ld;



pll exgcd(const long long x, const long long y)

{

    if (!y)

    {

        return make_pair(1, 0);

    }

    pll cur = exgcd(y, x % y);

    return make_pair(cur.second, cur.first - (x / y) * cur.second);

}



const long long __mod__ = 998244353;

long long mmod()

{

    return 1LL;

}

template <typename T, typename ...U>

long long mmod(const T &head, const U &... tail)

{

    return (head * mmod(tail...)) % __mod__;

}



long long mod(long long x, long long p = __mod__)

{

    return ((x % p) + p) % p;

}



void print() {}

template <typename T, typename... U>

void print(const T &head, const U &... tail)

{

    cout << head << (sizeof...(tail) ? ' ' : '\n');

    print(tail...);

}



#ifdef ConanYu

#define debug(...) print(__VA_ARGS__)

#else

#define debug(...) 0

#endif



inline long long fmul(long long a, long long c, const long long& Mod)

{

    a %= Mod, c %= Mod ;

    return (a * c - (long long)(((long double) a * c + 0.5) / Mod) * Mod) % Mod ;

}



long long gcd(long long x, long long y)

{

    return y == 0 ? x : gcd(y, x % y);

}



void solve();

int main()

{

#ifdef ConanYu

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

    // freopen("out.txt", "w", stdout);

    // freopen("2.in", "r", stdin);

    // freopen("2.out", "w", stdout);

    clock_t st = clock();

#endif



#ifdef CPPIO

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

#endif



    solve();



#ifdef ConanYu

    clock_t ed = clock();

    cerr << "time: " << ((ed - st) * 1.0 / CLOCKS_PER_SEC) << endl;

#endif

    return 0;

}



// *********************************************************************************************************



ll a[3333];

void solve()

{

    int n;

    cin >> n;

    int sum = 0;

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

    {

        cin >> a[i];

        sum += a[i];

    }

    cout << (sum - n) << endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.309406690139212x):
#include<cstdio>

using namespace std;

int main()

{



    int n,k,ans=0;

    scanf("%d",&n);

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

    {

        scanf("%d",&k);

        ans+=k-1;

    }

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

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

using namespace std;

const int maxn = 3010;

int a[maxn];

int main()

{

    int n; scanf("%d", &n);

    int sum = 0;

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

        int t;

        scanf("%d", &t);

        sum += (t-1);

    }

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

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.164236202321385x):
#include <cstdio>

#include <algorithm>

using namespace std;

typedef long long ll;

ll num[3010];

int main()

{

	int n;

	scanf("%d", &n);

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

	{

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

		num[i]--;

	}



	ll res = 0;

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

	{

		res += num[i];

	}

	printf("%lld", res);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

int main () {

	int n,x,i,sum=0;

	cin>>n;

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

    cin>>x;

    sum+=x;

	}

	sum-=n;

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.224836519846748x):
#include <stdio.h>

int main(){

	int n,s,answer = 0;

	scanf("%d",&n);

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

		scanf("%d",&s);

		answer += s-1;

	}

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

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

int main () {

	int n,x,i,sum=0;

	cin>>n;

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

    cin>>x;

    sum+=x;

	}

	sum-=n;

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.219153272376134x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

int a[300000];

int main()

{

    int n;

    scanf("%d", &n);

    long long sum=0;

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

    {

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

        sum += a[i];

    }

    printf("%lld\n",sum-n);



}
// Slower C++ solution:
#include<iostream>

using namespace std;

int N, sum = 0;



int main() {

    cin >> N;

    int a[N];

    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;

}

// Faster C++ solution for the same problem (measured speedup: 5.230715188800669x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

int a[300000];

int main()

{

    int n;

    scanf("%d", &n);

    long long sum=0;

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

    {

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

        sum += a[i];

    }

    printf("%lld\n",sum-n);



}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

int main () {

	int n,x,i,sum=0;

	cin>>n;

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

    cin>>x;

    sum+=x;

	}

	sum-=n;

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.231895881866904x):
#include<stdio.h>



int main(){

	

	int input;

	scanf("%d", &input);

	

	int arr[3005];

	int sum = 0;

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

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

		sum += arr[i];

	}

		

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

	

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int N, sum = 0;



int main() {

    cin >> N;

    int a[N];

    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;

}

// Faster C++ solution for the same problem (measured speedup: 5.243486026814012x):
#include<stdio.h>



int main(){

	

	int input;

	scanf("%d", &input);

	

	int arr[3005];

	int sum = 0;

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

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

		sum += arr[i];

	}

		

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

	

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll inf=0x3f3f3f3f;

ll a[3005];

int main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    ll n;

    cin>>n;

    ll sum=0;

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

        cin>>a[i];

        sum+=a[i]-1;

    }

    cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.304333211171568x):
#include<stdio.h>



int main(){

	

	int input;

	scanf("%d", &input);

	

	int arr[3005];

	int sum = 0;

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

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

		sum += arr[i];

	}

		

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

	

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

int main () {

	int n,x,i,sum=0;

	cin>>n;

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

    cin>>x;

    sum+=x;

	}

	sum-=n;

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.227795667685865x):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

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

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

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

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int N, sum = 0;



int main() {

    cin >> N;

    int a[N];

    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;

}

// Faster C++ solution for the same problem (measured speedup: 5.239376729486492x):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

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

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

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

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll inf=0x3f3f3f3f;

ll a[3005];

int main(){

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    ll n;

    cin>>n;

    ll sum=0;

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

        cin>>a[i];

        sum+=a[i]-1;

    }

    cout<<sum<<endl;

}


// Faster C++ solution for the same problem (measured speedup: 5.300176228168756x):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

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

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

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

}
// Slower C++ solution:
#include<iostream> 

#include<string>

#include<cstring>

#include<algorithm>

#include<cstdio>

#include<cmath>

#include<set>

#include<map>

#include<vector>

#include<queue>

#include<sstream>

using namespace std;

 

#define sf scanf

#define pf printf

#define pfn printf("\n");

#define pfk printf(" ");

#define pf0 printf("0");

#define pf1 printf("1");

#define ll long long

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

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

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

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

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

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

#define sfc(n) scanf("%c",n);

#define sfcc(n,m) scanf("%c%c",n,m);

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

#define sfss(n,m) scanf("%s%s",n,m);

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

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

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

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

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

 

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

int arr[1001][1001];

int main(){

	int t,n,m;

	cin>>n;

	int sum=0;

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

		int a;

		cin>>a;

		sum+=a-1;

	} 

	cout<<sum<<endl;

} 

// Faster C++ solution for the same problem (measured speedup: 5.236449957304546x):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

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

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

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

}
// Slower C++ solution:
/*g++ main.cpp -o main.out*/

/*./main.out*/



#include <map>

#include <set>

#include <list>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <bitset>

#include <cctype>

#include <cstdio>

#include <string>

#include <vector>

#include <climits>

#include <cstdlib>

#include <cstring>

#include <fstream>

#include <iomanip>

#include <sstream>

#include <iostream>

#include <iterator>

#include <algorithm>

using namespace std;



#define LL long long

#define LD long double

#define Mod 1000000007

#define L_Mod 17100000013



const double eps = 1e-9;

const int INF = 0x3f3f3f3f;

const double PI = 3.1415926535;



#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);



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



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

#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))

#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))



LL lcm(LL a,LL b)

{

    return a*b/__gcd(a,b);

}



LL a[100005];



int main()

{

    NO_TLE

    int n;

    cin>>n;

//    rep(i,n)cin>>a[i];

//    LL l=a[0];

//    rer(i,1,n-1)

//    {

//        LL t=__gcd(l,a[i]);

//        l=l/t*a[i];

//    }

//    LL sum=0;

//    l--;

//    rep(i,n)sum+=l%a[i];

//    cout<<sum<<endl;

    LL sum=0,x;

    while(n--)

    {

        cin>>x;

        sum+=x-1;

    }

    cout<<sum<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.3119545709067895x):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

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

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

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

}
// Slower C++ solution:
#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <algorithm>

#include <string.h>

#include <sstream>

#include <stack>



using namespace std;



int main()

{

   int n;

   scanf("%d",&n);

   int *a=new int[n];

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

   {

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

   }

   int sum=0;

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

   {

       sum+=a[i]-1;

   }

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

}


// Faster C++ solution for the same problem (measured speedup: 5.174696973934855x):
#include<stdio.h>

int main()

{

	int n,a,sum=0;

	scanf("%d",&n);

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

	{

		scanf("%d",&a);

		sum+=a;

	}

	sum-=n;

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

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

int main () {

	int n,x,i,sum=0;

	cin>>n;

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

    cin>>x;

    sum+=x;

	}

	sum-=n;

	cout<<sum;

}

// Faster C++ solution for the same problem (measured speedup: 5.226408583865242x):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

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

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

int N, sum = 0;



int main() {

    cin >> N;

    int a[N];

    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;

}

// Faster C++ solution for the same problem (measured speedup: 5.237986572878699x):
#include<stdio.h>

int main()

{

    int t,b;

    int sum=0;

    scanf("%d",&t);

    while(t--)

    {

        scanf("%d",&b);

        sum=sum+b-1;

    }

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

    return 0;

}