#include <stdio.h>
int find_max_element(int *ptr, int n) {
// 1. Initialize max to the very first element to handle negative numbers safely
int max = *ptr;
int *arr = ptr + 1;
// 2. Calculate the exact stopping address
int *end = ptr + n;
// 3. Scan from left to right
while (arr < end) {
// If the current locker's value is bigger than our recorded max, update it!
if (*arr > max) {
max = *arr;
}
// Move pointer to the next integer in memory
arr++;
}
// Return the largest number found
return max;
}
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;
}