N = int(input()) A = list(map(int, input().split())) X = N // 2 if N & 1: st = 1 Y = 0 for i, a in enumerate(A): if a <= X: Y += abs(st - i) st += 2 print(X,Y) else: B = [0] * X C = [0] * X j = 0 Y = 0 st = 1 for i, a in enumerate(A): if a <= X: B[j] = B[j - 1] + abs(st - i) st += 2 j += 1 j = X - 1 st = N - 2 for i in reversed(range(N)): if A[i] <= X: C[j] = C[(j + 1) % X] + abs(st - i) st -= 2 j -= 1 ans = min(B[X - 1], C[0]) for i in range(X-1): ans = min(ans, B[i] + C[i+1]) print(X,ans)