#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return a > b; }
int get(int arr[], int n, int val, int t) {
  int cost = 0;
  for (int i = 0; i < n; i++) {
    if (abs(arr[i] - val) <= 1) {
      continue;
    } else {
      cost += abs(arr[i] - val) - 1;
    }
  }
  return cost;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int sum = 0;
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  int ma = -1;
  for (int i = 0; i < n; i++) {
    ma = max(arr[i], ma);
  }
  int mid = ceil((double)sum / (double)n);
  int res = INT_MAX, t;
  for (int i = -1000; i <= 1000; i++) {
    if (i + mid > 0) {
      int r = get(arr, n, i + mid, t);
      if (r < res) {
        res = r, t = i + mid;
      }
    }
  }
  cout << t << " " << res;
  return 0;
}
