#include <bits/stdc++.h>

using namespace std;

queue <int> q;

long long n,i,a[10000007],c,k;

void dfs (int d) {
    for(int i=1; i<=n; i++) 
        while (q.size()>=1) {
            
        c+=q.front();
        q.pop();
      
        }
        
    }

int main()
{
    cin >> n;
    for (i=1; i<=n; i++){ cin >> a[i];
    
     q.push(a[i]-1);
    }
    
    dfs(i);
    
    if (n%2!=0){
        n-1;
        k=n/2;
        }
    else if (n%2==0)
    k=n/2;
    c=c-k;
    
    cout << c << endl;
    
return 0;
}
