n = int(input())
arr = list(map(int, input().split()))
n = max(arr)
for a in arr:
if a == max(arr) :
arr.remove(a)
print(max(arr))
Ans the question is to find the second highest number from a list but this code returns the highest number if there are many duplicate highest numbers.