#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int mod = (int)1e9 + 7;
const long double INF = (long double)(1e15);
const int N = 100005;
int n;
int x[N];
int main() {
  cin >> n;
  int dop;
  int ans = 0;
  for (int(i) = 0; (i) < (n); ++(i)) {
    scanf("%d", &dop);
    ans = max(ans, dop);
  }
  cout << ans << endl;
}
