#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int n1 = 0, n2, t = 0;
for(int i=0; i<n; i++){
cin>>n2;
n2>n1 ? t += (n2-n1)*6 : t += (n1-n2)*4;
n1 = n2;
}
t += n*5;
cout<<t;
return 0;
}
07-06
1622