#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
int a[101] = {0};
cin>>n;
for(int i = 1 ; i <= n ;i++){
cin>>a[i];
}
int total = 0;
for(int i = 0 ; i < n ; i++){
int data = a[i+1] - a[i];
if(data > 0){
total+=6*data;
}else{
total-=4*data;
}
}
total +=5*n;
cout<<total;
}
03-09
11-05
619
11-05
487