#include <bits/stdc++.h>
using namespace std;
const long long maxn = 5e5 + 20, maxt = 200, Mod = 1e9 + 7;
long long n, A[maxn], sum = Mod, t;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> A[i];
    sum += A[i];
  }
  for (long long i = 1; i < 100; i++) {
    long long tmp = 0;
    for (long long j = 0; j < n; j++) {
      tmp += min(min(abs(A[j] - i), abs(A[j] - i - 1)), abs(A[j] - i + 1));
    }
    if (sum > tmp) {
      sum = tmp;
      t = i;
    }
  }
  cout << t << " " << sum;
  return 0;
}
