#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const ll DIM=200007;
const ll INF=2000000007;

long long n,t,k,num,mini,maxi,mina,maxa,x,p,cost;
bool res;

int main()
{
    cin >> n;
    vector<int>v(n);

    for (int i=0;i<n;i++) cin >> v[i];

    reverse(v.begin(),v.end());

    p=0;
    cost=0;
    for (int i=0;i<n;i++)
    {
        cost+=v[i]-p;
        p++;
    }
    cout << cost << endl;

    return 0;
}
