n = int(input()) A = list(map(int, input().split())) m = n // 2 A = [a <= m for a in A] ind = [i for i, a in enumerate(A) if a] if n & 1: X = [i for i in range(1, n, 2)] ans = sum(abs(i - x) for i, x in zip(ind, X)) else: X = [i for i in range(0, n, 2)] tot = sum(abs(i - x) for i, x in zip(ind, X)) ans = tot for i in range(m): tot -= abs(ind[i] - X[i]) X[i] += 1 tot += abs(ind[i] - X[i]) ans = min(ans, tot) print(m, ans)