n=input() w=sorted(map(int,raw_input().split()))[::-1] a=b=0 for i in w: if a