#include <bits/stdc++.h>
using namespace std;
const int64_t infll = 9223372036854775807LL;
void solve() {
  int64_t n;
  cin >> n;
  vector<int64_t> a(n);
  for (int64_t i = (0); i < (n); ++i) cin >> a[i];
  sort(a.begin(), a.end());
  int64_t mincost = infll;
  int64_t tbest = -1;
  for (int64_t t = (1); t <= (100); ++t) {
    int64_t cost = 0;
    for (int64_t i = (0); i < (n); ++i) {
      int64_t m = abs(a[i] - t);
      if (m > 1) cost += m - 1;
    }
    if (cost < mincost) {
      mincost = cost;
      tbest = t;
    }
  }
  cout << tbest << " " << mincost << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(15);
  solve();
  return 0;
}
