#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  long long ans = 1e9, wh = -1;
  for (long long t = 1; t < 1000; t++) {
    long long here = 0;
    for (long long i = 0; i < n; i++) {
      long long diff = abs(v[i] - t);
      if (diff <= 1) continue;
      here += diff - 1;
    }
    if (here < ans) {
      ans = here, wh = t;
    }
  }
  cout << wh << " " << ans;
  return 0;
}
