N = int(input()) A = list(map(int, input().split())) D = [] for i in range(N): if A[i] <= N//2: D.append(i) ans = 0 if N % 2: E = list(range(1, N, 2)) for i in range(N//2): ans += abs(D[i] - E[i]) else: EL = list(range(0, N, 2)) ER = list(range(1, N, 2)) EL.reverse() Left = [0] * (N//2 + 1) Right = [0] * (N//2 + 1) cntL, cntR = 0, 0 ans = 10 ** 18 for i in range(N//2): cntL += abs(D[N//2 - i - 1] - EL[i]) cntR += abs(D[i] - ER[i]) Left[i + 1] = cntL Right[i + 1] = cntR for i in range(N//2 + 1): ans = min(ans, Left[i] + Right[N//2 - i]) print(N//2, ans)