func_code_string: #include <bits/stdc++.h>   using namespace std;   void boost() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);   }   void free() {     freopen( A.in ,  r , stdin);     freopen( A.out ,  w , stdout);   }   int a[100001];   int main() {     boost();     int n;     cin >> n;     for (int i = 0; i < n; i++) cin >> a[i];     long long ans = 1, h = a[0];     ans += h;     for (int i = 1; i < n; i++) {       if (a[i] >= h)         ans += (a[i] - h + 1), h = a[i];       else if (a[i] < h)         ans += (h - a[i] + 1), h = a[i];       ans++;     }     cout << ans, exit(0);   }   