#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long t, ans = 10000000, cost = 1000000;
  for (t = 1; t <= 100; t++) {
    long long c = 0;
    for (i = 0; i < n; i++) {
      if (a[i] != t) c += abs(a[i] - t) - 1;
    }
    if (c < cost) {
      cost = c;
      ans = t;
    }
  }
  cout << ans << " " << cost;
}
