#include <bits/stdc++.h>
using namespace std;
bool Check(unsigned int N, int pos) { return (bool)(N & (1LL << pos)); }
long long Set(unsigned int N, int pos) { return N = N | (1LL << pos); }
long long a[100005];
int main() {
  long long int ii, i, j, n, k, m, z = 0, c = 0, t, x, y, l, r, mid;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) scanf("%lld", &a[i]);
  z = 1999999999;
  for (i = 1; i <= 105; i++) {
    c = 0;
    for (j = 0; j < n; j++) {
      x = abs(i - a[j]);
      if (x > 1) c += x - 1;
    }
    if (z > c) {
      z = c;
      y = i;
    }
  }
  cout << y << " " << z << endl;
}
