#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int res = 0, d = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] > 1) res = res + abs(a[i] - 1);
  }
  for (int i = 1; i <= 100; i++) {
    int sum = 0;
    for (int j = 0; j < n; j++) {
      if (a[j] < i)
        sum = sum + abs(i - a[j] - 1);
      else if (a[j] > i)
        sum = sum + abs(a[j] - i - 1);
    }
    if (sum < res) {
      res = sum;
      d = i;
    }
  }
  cout << d << " " << res << endl;
  return 0;
}
