import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 n = ii() a = li() x = n // 2 b = [] for i in range(n): if a[i] <= x: b.append(i) c = [2 * i + 1 for i in range(n // 2)] ans = 0 for i in range(len(c)): ans += abs(b[i] - c[i]) if n % 2 == 0: now = ans for i in range(len(c) - 1, -1, -1): now -= abs(b[i] - c[i]) c[i] -= 1 now += abs(b[i] - c[i]) ans = min(ans, now) print(x, ans)