#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h[n], maxv, total = 1, i;
  cin >> n;
  for (i = 0; i <= n - 1; i++) cin >> h[i];
  maxv = h[0];
  for (i = 1; i <= n; i++) {
    if (h[i] > h[i - 1]) maxv = h[i];
    total++;
    if (h[i] = h[i - 1]) maxv = h[i];
    total++;
  }
  cout << total;
  return 0;
}
