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