#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int n, h;
int main() {
  scanf("%d", &n);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h);
    ans = max(ans, h);
  }
  printf("%d\n", ans);
  return 0;
}
