#35437: python 4行解


leoho335@gmail.com (ゴーストキング)


s = input()
tmp = list(map(int, input().split()))
tmp.sort()
print(tmp[len(tmp) - 1])