def solve(n, a): x = n // 2 y = 0 ind = [] for i in range(n): if a[i] <= x: ind.append(i) if n % 2 == 1: for i, v in enumerate(ind): y += abs(v - (2 * i + 1)) else: y1 = 0 y2 = 0 for i, v in enumerate(ind): y1 += abs(v - (2 * i + 1)) y2 += abs(v - 2 * i) y = y2 return x, y n = int(input()) a = list(map(int,input().split())) print(*solve(n, a))