#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
  int N;
  cin >> N;
  vecotr<int> H(N);
  for (int i=0;i<N;i++){
    cin >> H[i];
  }
  
  int ans=0;
  
  for (i=1;i<N;i++){
    if (H[i] => H[i-1]){
      ans += a;
    }
  }
  
  cout << ans + a <<endl;
  
}