#include <bits/stdc++.h>
using namespace std;
const long long int inf = 2000000000;
const long double eps = 0.0000001;
const long double pi = acos(-1.0);
const long long int MOD = 998244353;
const long long int N = 1e5 + 5;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long int ans = 1, mn = inf;
  for (long long int t = 1; t <= 100; t++) {
    long long int s = 0;
    for (long long int i = 0; i < n; ++i) {
      if (a[i] > t + 1)
        s += a[i] - t - 1;
      else if (a[i] < t - 1)
        s += t - a[i] - 1;
    }
    if (s < mn) {
      mn = s;
      ans = t;
    }
  }
  cout << ans << " " << mn;
  return 0;
}
