#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long ar[n];
  for (long long int i = 0; i < n; i++) cin >> ar[i];
  long long ans = 0;
  long long cost = 1000000007;
  for (long long int i = 1; i < 101; i++) {
    long long tmp = 0;
    for (long long int j = 0; j < n; j++) {
      tmp += (max(0ll, abs(ar[j] - i) - 1));
    }
    if (tmp < cost) {
      ans = i;
      cost = tmp;
    }
  }
  cout << ans << ' ' << cost << '\n';
  return 0;
}
