import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### n = ni() a = na() b = [] def f(p,q): r = 0 for i in range(len(p)): r += abs(p[i]-q[i]) return r for i in range(n): if a[i] <= n//2: b.append(i) if n % 2: c = list(range(1,n,2)) print(n//2,f(b,c)) else: p = [0] for i in range(n//2): p.append(p[-1] + abs(b[i] - i * 2 - 1)) ans = p[-1] x = 0 for i in range(n//2-1,-1,-1): x += abs(b[i]-2*i) #print(b[i],2*i,p[i],x) ans = min(ans, p[i] + x) print(n//2,ans)