#include <stdio.h>
int find_max_element(int *ptr, int n) {
// Your logic here
int *end = ptr + n;
int max = *ptr;
while(ptr < end)
{
if(*ptr > max)
{
max = *ptr;
}
ptr++;
}
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;
}