#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& out, const pair<A, B>& a) {
  return out << "(" << a.first << ", " << a.second << ")";
}
template <class A>
ostream& operator<<(ostream& out, const vector<A>& a) {
  out << "[";
  for (auto it = a.begin(); it != a.end(); ++it) {
    if (it != a.begin()) out << ", ";
    out << *it;
  }
  return out << "]";
}
const int INF = 1e9;
const long long INF64 = 1e18;
const int MOD = 1e9 + 7;
const long double PI = acosl(-1.0);
const long double EPS = 1e-9;
mt19937 rnd(time(NULL));
mt19937_64 rnd64(time(NULL));
const int N = 1010;
int n;
int a[N];
bool read() {
  if (!(cin >> n)) return false;
  for (int i = 0; i < int(n); ++i) cin >> a[i];
  return true;
}
void solve() {
  int mint = -1, ans = INF;
  for (int t = 1; t <= 105; ++t) {
    int res = 0;
    for (int i = 0; i < n; ++i) {
      int mn = INF;
      for (int j = -1; j <= 1; ++j) {
        int cur = max(1, a[i] + j);
        mn = min(mn, abs(cur - t));
      }
      res += mn;
    }
    if (ans > res) {
      mint = t;
      ans = res;
    }
  }
  cout << mint << " " << ans << endl;
}
int main() {
  cout << fixed << setprecision(10);
  cerr << fixed << setprecision(10);
  if (read()) {
    solve();
  }
}
