import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) B=[1]*N for i in range(N): if A[i]<=N//2: B[i]=0 C=[1]*N for i in range(N): if i%2==1: C[i]=0 X=[] Y=[] for i in range(N): if B[i]==0: X.append(i) if C[i]==0: Y.append(i) AX=[0]*len(X) for i in range(len(X)): AX[i]=abs(X[i]-Y[i]) if N%2==1: print(N//2,sum(AX)) exit() C=[1]*N for i in range(N): if i%2==0: C[i]=0 Y=[] for i in range(N): if C[i]==0: Y.append(i) BX=[0]*len(X) for i in range(len(X)): BX[i]=abs(X[i]-Y[i]) for i in range(1,len(X)): AX[i]+=AX[i-1] for i in range(len(X)-2,-1,-1): BX[i]+=BX[i+1] ANS=min(AX[-1],BX[0]) for i in range(len(X)-1): ANS=min(ANS,AX[i]+BX[i+1]) print(N//2,ANS)