#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[1111];
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int a1, a2 = (1 << 30);
  for (int i = 1; i <= 100; ++i) {
    int tp = 0;
    for (int j = 0; j < n; ++j) {
      int tt = min(abs(i - a[j]), abs(i + 1 - a[j]));
      tt = min(tt, abs(i - 1 - a[j]));
      tp += tt;
    }
    if (tp < a2) a1 = i, a2 = tp;
  }
  cout << a1 << ' ' << a2 << ('\n');
}
