#include <bits/stdc++.h>
int main() {
  int n, i, j, max, x;
  while (scanf("%d", &n) != EOF) {
    max = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &x);
      if (max < x) max = x;
    }
    printf("%d\n", max);
  }
}
