/* unknown words :
     denote: 表示
     specified: 特定的
     fulfill: 完成,履行,满足
*/
/*
   按题意做就好了,暴力模拟
*/
#include<cstdio>
using namespace std;
int main()
{
    int n,pre = 0,now = 0;
    scanf("%d",&n);
    int sum = n*5;
    while(n--)
    {
        scanf("%d",&now);
        if(now>pre) sum += 6*(now-pre);
        else sum += 4*(pre-now);
        pre = now;
    }
    printf("%d\n",sum);
    return 0;
}