#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[1000], min_t, min_op = 999999, temp_op;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int t = 1; t <= 200; t++) {
    temp_op = 0;
    for (int i = 0; i < n; i++) {
      if (abs(t - a[i]) > 1) {
        temp_op += abs(t - a[i]) - 1;
      }
    }
    if (temp_op < min_op) {
      min_op = temp_op;
      min_t = t;
    }
  }
  cout << min_t << " " << min_op;
  return 0;
}
