#include <bits/stdc++.h>
using namespace std;
bool checkoverlap(long long int x1, long long int x2, long long int x3,
                  long long int x4, long long int y1, long long int y2,
                  long long int y3, long long int y4) {
  if ((x1 > x4) || (x3 > x2)) {
    return false;
  }
  if ((y2 < y3) || (y4 < y1)) {
    return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int a[n], i, j, count = 0, minm = INT_MAX, t = 0;
  for (i = 0; i < n; i = i + 1) {
    cin >> a[i];
  }
  for (i = 1; i <= 100; i = i + 1) {
    for (j = 0; j < n; j = j + 1) {
      if (i > a[j]) {
        count = count + (i - a[j] - 1);
      } else if (i < a[j]) {
        count = count + (a[j] - i - 1);
      }
    }
    if (count < minm) {
      minm = count;
      t = i;
    }
    count = 0;
  }
  cout << t << " " << minm << endl;
}
