#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
const int INF = 1e9 + 10;
int ans, t, n, ANS, a[500010];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) getint(a[i]);
  ANS = INF;
  for (int i = 1; i <= 200; ++i) {
    t = 0;
    for (int j = 1; j <= n; ++j)
      if (a[j] < i - 1)
        t += i - 1 - a[j];
      else if (a[j] > i + 1)
        t += a[j] - i - 1;
    if (t < ANS) {
      ans = i;
      ANS = t;
    }
  }
  cout << ans << ' ' << ANS << endl;
  return 0;
}
