#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, sum = 0, cnt = 0;
  cin >> n;
  int *p = new int[n];
  for (i = 0; i < n; i++) {
    cin >> p[i];
  }
  int min = 100000;
  for (i = 1; i <= 100; i++) {
    sum = 0;
    for (int j = 0; j < n; j++) {
      if (i - p[j] != 0) sum += abs(i - p[j]) - 1;
    }
    if (min > sum) {
      k = i;
      min = sum;
    }
  }
  cout << k << " " << min << endl;
  return 0;
}
