#include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int t, now;
now = t = 0;
int nxt;
for(int i = 0; i < n; i ++ ){
cin >> nxt;
if(nxt == now) t += 5;
else if(nxt > now) t += (nxt - now) * 6 + 5;
else t += (now - nxt) * 4 + 5;
now = nxt;
}
cout << t << endl;
return 0;
}