#include <cstdio>
#include <algorithm>
using namespace std;
int n;
int main()
{
scanf("%d",&n);
int temp = 0,k,t,sum = 0;
for(int i = 0; i < n; i++){
scanf("%d",&k);
t = k - temp;
sum += 5;
if(t > 0) sum += 6 * t;
if(t < 0) sum += 4 *(-t);
temp = k;
}
printf("%d",sum);
return 0;
}