import java.util.*;
public class java{
public static void main(String[] args){
int max;
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int n=sc.nextInt();
int cup[]=new int[n];
for(int i=0;i<cup.length;i++){
cup[i]=sc.nextInt();
}
Arrays.sort(cup);
System.out.print(cup[cup.length-1]);
}
}
}