#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long INF64 = 1e18;
const int MOD = 1e9 + 7;
const long double PI = acosl(-1.0);
const long double EPS = 1e-9;
const int N = 101;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < int(n); ++i) cin >> a[i];
  int best = 1;
  int sum = INF;
  for (int t = int(1); t < int(N); ++t) {
    int tmp = 0;
    for (int i = 0; i < int(n); ++i) {
      tmp += abs(a[i] - t);
      if (abs(a[i] - t) > 0) tmp--;
    }
    if (tmp < sum) {
      sum = tmp;
      best = t;
    }
  }
  cout << best << ' ' << sum << endl;
}
