#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, sum = 1e6;
  cin >> n;
  long a[n];
  for (long i = 0; i < n; cin >> a[i++])
    ;
  long opt;
  for (long i = 1; i <= 1000; ++i) {
    long s = 0;
    for (long j = 0; j < n; ++j) {
      if (i != a[j]) s += abs(i - a[j]) - 1;
    }
    if (s < sum) {
      sum = s;
      opt = i;
    }
  }
  cout << opt << ' ' << sum << endl;
}
