#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, s, id;
  int is = INT_MAX;
  cin >> n;
  vector<long long> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  for (i = 0; i <= 101; i++) {
    s = 0;
    for (j = 0; j < v.size(); j++) {
      if (v[j] > i) {
        s += (v[j] - i - 1);
      } else if (v[j] < i) {
        s += (i - 1 - v[j]);
      }
    }
    if (s <= is) {
      is = s;
      id = i;
    }
  }
  cout << id << " " << is;
}
