module main;

import std.stdio : readln, writeln, write, writefln, writef;
import std.conv : to;
import std.array : split, replace;
import std.string : strip;
import std.algorithm : max, min, map, reduce, sort, reverse;
import std.functional : memoize;

version = B;

version (A)
{
    void main()
    {
        auto sequence = read_one!string();
        auto instructions = read_one!string();
        size_t position = 0;
        foreach (instruction; instructions)
        {
            if (sequence[position] == instruction)
            {
                position += 1;
            }
        }
        writeln(position + 1);
    }
}
version (B)
{
    T abs(T)(T x)
    {
        if (x < 0) return -x; return x;
    }
    void main()
    {
        auto n = read_one!int();
        auto heights = new int[n+1];
        foreach (i; 1..n+1)
        {
            heights[i] = read_one!int();
        }
        auto answer = n * 2 - 1;
        foreach (i; 0..n)
        {
            answer += abs(heights[i] - heights[i+1]);
        }
        writeln(answer);
        // walks: heights[0] + (heights[i] - heights[i-1]).map!abs.sum
        // jumps: n-1
        // eats: n
    }
}
version (C)
{
    void main()
    {
        auto n = read_one!int();
    }
}
version (D)
{
    void main()
    {
        auto n = read_one!int();
    }
}
version (E)
{
    void main()
    {
    }
}

T read_one(T)()
{
    return readln().strip().to!T();
}
 
T[] read_some(T)()
{
    T[] ret;
    foreach (e; readln().strip().split())
    {
        ret ~= e.to!T();
    }
    return ret;
}

T[m] read_fixed(int m, T)()
{
    T[m] ret;
    foreach (i, e; readln().strip().split())
    {
        ret[i] = e.to!T();
    }
    return ret;
}
