#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i, a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  long int min = 1000000000, sum = 0, tmax = 0, j;
  for (i = 1; i <= 100; i++) {
    for (j = 0; j < n; j++) {
      if (i < a[j]) sum = sum + (a[j] - i - 1);
      if (i > a[j]) sum = sum + (i - a[j] - 1);
    }
    if (sum < min) {
      min = sum;
      tmax = i;
    }
    sum = 0;
  }
  cout << tmax << " " << min;
}
