#include <stdio.h>
int find_max_element(int *ptr, int n) {
int *end = ptr + n-1;
int mx = *ptr;
while (ptr <= end) {
if (*ptr > mx) {
mx = *ptr;
}
ptr++;
}
return mx;
}
int main() {
int n;
scanf("%d", &n);
int arr[100];
for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
int result = find_max_element(arr, n);
printf("%d", result);
return 0;
}