#include <bits/stdc++.h>
using namespace std;
int n, num[1010];
int getlen(int x) {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (x < num[i])
      ans += num[i] - x - 1;
    else if (x > num[i])
      ans += x - num[i] - 1;
  }
  return ans;
}
int main() {
  cin >> n;
  int max = 0, min = 110, ans = 100000000, index = 0;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
    min = min > num[i] ? num[i] : min;
    max = max > num[i] ? max : num[i];
  }
  for (int i = min; i <= max; i++) {
    int cur = getlen(i);
    if (cur < ans) {
      ans = cur;
      index = i;
    }
  }
  cout << index << " " << ans;
  return 0;
}
