def solve(): N=int(input()) A=[-1]+list(map(int,input().split())) X=N//2; Y=0 T=[i for i in range(1,N+1) if A[i]<=X] if N%2==1: for i,t in enumerate(T,1): Y+=abs(2*i-t) else: y=z=0 for i,a in enumerate(T,1): y+=abs(2*i-1-a) z+=abs(2*i-a) Y=min(y,z) for i,a in enumerate(T,1): y+=abs(2*i-a)-abs(2*i-1-a) Y=min(Y,y) for j in range(N//2-1,-1,-1): k=j+1; a=T[j] z+=abs(2*k-1-a)-abs(2*k-a) Y=min(Y,z) print(X,Y) solve()