#include <bits/stdc++.h>
using namespace std;
template <typename T>
void write(vector<T> &a) {
  for (auto it = a.begin(); it != a.end(); it++) cout << *it << " ";
  cout << endl;
}
void random(int a, int b, int n) {
  srand(time(0));
  for (int i = 0; i < n; i++) cout << rand() % b + a << " ";
  cout << endl;
}
long long int max(long long int a, long long int b) { return (a > b) ? a : b; }
long long int min(long long int a, long long int b) { return (a < b) ? a : b; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(15);
  {
    long long int n;
    cin >> n;
    vector<long long int> arr(n);
    for (int i = 0; i < n; i++) cin >> arr[i];
    long long int minima = INT_MAX, topt;
    for (int t = 1; t < 101; t++) {
      long long int sum = 0;
      for (int j = 0; j < n; j++) {
        if (abs(t - arr[j]) > 1) sum += abs(t - arr[j]) - 1;
      }
      if (sum < minima) {
        minima = sum;
        topt = t;
      }
    }
    cout << topt << " " << minima << endl;
  }
  return 0;
}
