#include <bits/stdc++.h>
using namespace std;
const long long MOD=10e9+7;
#define Std 100003
#define StdD 100007
#define StdINF 1000000007
#define endl "\n"
#define ll long long
#define ull unsigned long long
#define ld long double
#define st string
#define ch char
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define sl set<ll>
ll n,res,maxx,minn;
ll k[Std];
void vv()
{
res+=maxx;
res+=maxx-1;
res+=minn;
res+=minn+1;
res-=minn;
}
void Start()
{
    maxx=-99999;
    minn=99999;
    cin>>n;
    for(int i=1;i<=n;i++)
        {
        cin>>k[i];
        if(k[i]>maxx)
        {
            maxx=k[i];
        }
        if(k[i]<minn)
        {
            minn=k[i];
        }
        }

        vv();
        cout<<res+1;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    Start();

    return 0;
}
