//简单循环
//不用忘记更新cur
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int last=0;
int res=0;
while(n--)
{
int cur;
cin>>cur;
if(last<cur) res+=(cur-last)*6+5;
else res+=(last-cur)*4+5;
last=cur;
}
cout<<res<<endl;
return 0;
}