#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& x : a) {
    cin >> x;
  }
  int t = 0;
  int s_min = 1000000;
  for (int i = 1; i <= 100; i++) {
    int s_tmp = 0;
    for (int x : a) {
      if (abs(x - i) > 1) {
        s_tmp += abs(x - i) - 1;
      }
    }
    if (s_tmp < s_min) {
      s_min = s_tmp;
      t = i;
    }
  }
  cout << t << " " << s_min;
  return 0;
}
