def bubble_sort(array):
    for i in range(len(array)):
        for j in range(len(array)):
            if array[j]<array[i]:
                temp = array[j]
                array[j]=array[i]
                array[i]=temp
    #print(array)
    return array


looper = int(input())

list=" "
list2=[]
list = input()
list2 = str.split(list)
for i in range(len(list2)):
    list2[i]=int(list2[i])
#print(type(list2[0]))
flag=3
#print(list2)
if (looper>=2 and looper<=10):
    for i in range(0,len(list2)):
        if list2[i]>=-100 and list2[i]<=100:
            flag=0
        else:
            flag=1


if (flag!=1):
    #print(type(sorted(set(list2))))
    list2=sorted(set(list2))
    list = bubble_sort(list2)
    print(list2[1])