#include <bits/stdc++.h>
using namespace std;
const int maxn = 500000;
const int INF = 2e9;
const int mod = 10007;
int n, a[1005], t, po;
int ant;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  ant = 100000000000;
  for (t = 1; t <= 105; t++) {
    int ret = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] < t - 1) {
        ret += abs(a[i] - t + 1);
      } else if (a[i] > t + 1) {
        ret += abs(a[i] - t - 1);
      }
    }
    if (ret < ant) {
      ant = ret;
      po = t;
    }
  }
  printf("%d %d\n", po, ant);
  return 0;
}
