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) dp = [[0] * 2 for _ in range(X)] dp[0][0] = abs(0 - l[0]) dp[0][1] = abs(1 - l[0]) for i in range(1,X): dp[i][0] = abs(i * 2 - l[i]) + min(dp[i-1]) dp[i][1] = abs(i * 2 + 1 - l[i]) + dp[i-1][1] print(min(dp[-1]))