n = int(input()) a = list(input().split()) for i in range(n): if a[0] < a[i]: a[0] = a[i] print(a[0])