#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ans = 0, fh = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ans = ans * 10 + ch - '0', ch = getchar();
  return ans * fh;
}
const int maxn = 1100;
int n, a[maxn];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  int Ans = 0x7fffffff, mx = 0;
  for (int i = 1; i <= 100; i++) {
    int ans = 0;
    for (int j = 1; j <= n; j++) ans += max(abs(i - a[j]) - 1, 0);
    if (ans < Ans) Ans = ans, mx = i;
  }
  printf("%d %d\n", mx, Ans);
  return 0;
}
