#include <bits/stdc++.h>
using namespace std;
constexpr int64_t INF = 1000000000;
void solve(istream &cin) {
  int64_t N;
  if (!(cin >> N)) {
    return;
  }
  vector<int> a;
  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
  int64_t minT, minc;
  minT = -1;
  minc = INF;
  for (int t = 1; t <= 100; ++t) {
    int64_t cost = 0;
    for (auto &&am : a) {
      int64_t X = abs(am - t);
      if (X > 1) {
        cost += X - 1;
      }
    }
    if (cost < minc) {
      minT = t;
      minc = cost;
    }
  }
  cout << minT << ' ' << minc << endl;
}
int main(int argc, char *argv[]) {
  string FileName("A"), Modifier("MEPH_");
  string ExecutionName = Modifier + FileName;
  string sub(argv[0]);
  if (sub.size() > ExecutionName.size())
    sub = sub.substr(sub.size() - ExecutionName.size(), ExecutionName.size());
  cout << setprecision(16) << scientific;
  if (sub != ExecutionName) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while (cin) {
      solve(cin);
    }
  } else {
    cerr << sub << " test" << endl;
    string inFile = FileName + ".txt";
    auto fs = fstream(inFile, fstream::in);
    while (fs) {
      solve(fs);
    }
  }
}
