n=int(input()) s=list(map(int,input().split())) ans=1 for i in range(n): for j in range(i+1,n): if s[i]>s[j]:ans*=-1 print(ans)