#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; ++i) cin >> A[i];
  int best_t = -1, ans = 0x3f3f3f3f;
  for (int t = 1; t <= 100; ++t) {
    int cost = 0;
    for (int a : A) {
      if (abs(a - t) <= 1) continue;
      if (t < a)
        cost += a - t - 1;
      else
        cost += t - a - 1;
    }
    if (cost < ans) {
      ans = cost;
      best_t = t;
    }
  }
  cout << best_t << " " << ans << endl;
  return 0;
}
