#include <iostream>
using namespace std;

// 1008 Elevator (20)（20 point(s)）
int main(void)
{
    int n;
    cin >> n;

    int sum = 0, old = 0, t;
    for (int i = 0; i < n; ++i)
    {
        cin >> t;

        if (t - old > 0)
        { // up
            sum += (t - old) * 6;
        }
        else
        {
            sum += (old - t) * 4;
        }
        sum += 5;
        old = t;
    }

    cout << sum << endl;

    return 0;
} // jinzheng 2018.7.24 11:03