#include <bits/stdc++.h>
using namespace std;
int a[1007];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int x, y = INT_MAX;
  for (int i = 1; i <= 100; i++) {
    int mx = 0;
    for (int j = 1; j <= n; j++) {
      mx += max(0, abs(i - a[j]) - 1);
    }
    if (mx < y) {
      x = i;
      y = mx;
    }
  }
  cout << x << ' ' << y << endl;
  return 0;
}
