a = int(input()) k = [] n = 0 k = map(int,input().split()) #k.sort for i in k: if i > n: n = i print(n)