#include <bits/stdc++.h>
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    int high, maxH = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &high);
      if (maxH < high) maxH = high;
    }
    printf("%d\n", maxH);
  }
  return 0;
}
