b = int(input()) a = list(map(int,input().split())) biggest = 0 for num in a: biggest = max(biggest,num) print(biggest)