#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> v(N);
  for(int i = 0;i < N; i++){
    cin >> v.at(i);}
  int ans = 0;
  for(int i=; i<N; i++){
    while(v.at(i) > v.at(i+1)){
      v.at(i+1) += 1;
      ans++;}
  }
}
  