#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<long long, long long> > v;
map<long long, long long> mp;
long long a[N], cnt, f, g, n;
long long dp[N], mini = 1e9;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= 100; i++) {
    long long sum = 0;
    for (int j = 1; j <= n; j++) {
      if (abs(i - a[j]) <= 1)
        continue;
      else {
        if (i > a[j])
          sum += (i - a[j] - 1);
        else
          sum += (a[j] - i - 1);
      }
    }
    if (sum < mini) {
      mini = sum;
      g = i;
    }
  }
  cout << g << " " << mini;
}
