#include<stdio.h>
#include<math.h>
int main()
{
int a,sum=0;
int j=1;
int b[100];
b[0]=0;
scanf("%d",&a);
for(int i=1;i<=a;i++){
scanf("%d",&b[i]);
sum++;
}
sum=sum*5;
while(a>0){
if(b[j]>b[j-1])
{
sum =sum +(b[j]-b[j-1])*6;
}else{
sum =sum +(b[j-1]-b[j])*4;
}
a--;
j++;
}
printf("%d",sum);
return 0;
}
09-09