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: assert 0 for i,t in enumerate(T,1): Y+=min(abs(2*i-t), abs(2*i-1-t)) print(X,Y) solve()