#include <iostream>
using namespace std;
int main() {
int n,last=0,temp,time=0;
cin>>n;
for(int i=0;i<n;++i){
cin>>temp;
if(temp>last) time+=(temp-last)*6+5;
else time+=(last-temp)*4+5;
last=temp;
}
printf("%d",time);
return 0;
}