#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  cin >> n;
  int arr[n];
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  if (n == 1) {
    cout << arr[0] + 1 << " "
         << "0\n";
    return 0;
  }
  int ans = 1000000;
  int ind;
  int c = 0;
  for (i = 1; i < 101; i++) {
    c = 0;
    for (j = 0; j < n; j++) {
      if (abs(i - arr[j]) > 0) c = c + abs(i - arr[j]) - 1;
    }
    if (c <= ans) {
      ans = c;
      ind = i;
    }
  }
  cout << ind << " " << ans << endl;
  return 0;
}
