#include <stdio.h>
int main(void) {
int a;
int x[10000];
int b=0;
int z;
int y;
int r;
scanf("%d", &a);
for (int i = 0; i < a; i++) {
scanf("%d", &x[i]);
}
for (int p = 1; p < a; p++) {
if (x[p - 1] < x[p]) {
b = b+(x[p] - x[p - 1]) * 3;
}
if (x[p] < x[p - 1]) {
b = b+( x[p-1] - x[p]) * 2;
}
}
r = (x[0] - 1) * 3;
printf("%d\n", b + r );
return 0;
}