output_description: Print the minimum number of watering operations required to satisfy the
  condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      h_1 h_2 h_3 ...... h_N
attempt: #include<iostream>
  #include<algorithm>
  #include<vector>
  #include<string>
  #include<set>
  #include<map>
  using namespace std;
  typedef long long ll;
  typedef long long int llint;
  typedef pair<ll, ll> pa;
  #define MM 1000000000
  #define MOD MM+7
  #define MAX 101000
  #define MAP 110
  #define initial_value -1
  #define Pair pair<int,int>
  #define chmax(a,b) (a<b ? a=b:0)
  #define chmin(a,b) (a>b ? a=b:0)
  #define INF (1 << 29) //536870912
  int dx[4] = {-1,0,1,0};
  int dy[4] = {0,-1,0,1};
  int main(){
      int n; cin >> n;
      int h[101];
      cin >> h[0];
      int ans = h[0];
      for(int i = 1; i < n; i++){
          cin >> h[i];
          if(h[i] >= h[i-1]){
              ans += (h[i] - h[i-1]);
          }
      }
      cout << ans << endl;
  }
  
  
problem_description: Statement
  
  In a flower bed, there are N flowers, numbered 1,2,......,N. Initially, the
  heights of all flowers are 0. You are given a sequence
  h=\\{h_1,h_2,h_3,......\\} as input. You would like to change the height of
  Flower k to h_k for all k (1 \leq k \leq N), by repeating the following
  "watering" operation:
  
    * Specify integers l and r. Increase the height of Flower x by 1 for all x such that l \leq x \leq r.
  
  Find the minimum number of watering operations required to satisfy the
  condition.
samples: [{"input": "4\n    1 2 2 1", "output": "2\n    \n\nThe minimum number of watering operations required is 2. One way to achieve it\nis:\n\n  * Perform the operation with (l,r)=(1,3).\n  * Perform the operation with (l,r)=(2,4).\n\n* * *"}, {"input": "5\n    3 1 2 3 1", "output": "5\n    \n\n* * *"}, {"input": "8\n    4 23 75 0 23 96 50 100", "output": "221"}]