N = int(input()) A = list(map(int,input().split())) import sys if N % 2 == 1: X = N // 2 print(N // 2,end = " ") l = [] for i in range(N): if A[i] <= X: l.append(i) tmp = [] for i in range(N): if i & 1 == 1: tmp.append(i) ans = 0 for k in range(len(l)): ans += abs(l[k] - tmp[k]) print(ans) exit() X = N // 2 print(X,end = " ") l = [] for i in range(N): if A[i] <= X: l.append(i) ans = 0 for i in range(X): ans += min(abs(i * 2 - l[i]),abs(i * 2 + 1 - l[i])) print(ans)