#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const double eps = 1e-9;
const long long mod = 1e9 + 7;
const long long llinf = (1ll << 60);
const int lim = 1e2 + 5;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(15);
  long long n, m = llinf, aux, mm;
  cin >> n;
  vector<int> v(n);
  for (int i = (0); i <= ((n)-1); i += (+1)) {
    cin >> v[i];
  }
  for (int i = (1); i <= ((lim)); i += (+1)) {
    aux = 0;
    for (int j = (0); j <= ((n)-1); j += (+1)) {
      if (abs(v[j] - i) > 1) {
        aux += abs(1 - abs(v[j] - i));
      }
    }
    if (aux < m) {
      m = aux;
      mm = i;
    }
  }
  cout << mm << ' ' << m << '\n';
  return 0;
}
