#include <bits/stdc++.h>
const int Inf = 1e9;
long long LINF = (long long)4e18;
using namespace std;
long long mod = 1e9 + 7;
long long mod2 = 1e9 + 123;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  int n;
  cin >> n;
  vector<int> a(n);
  for (int(i) = 0; (i) < n; (i)++) cin >> a[i];
  long long mn = 1e18;
  long long t = -1;
  for (int(i) = 1; (i) < 101; (i)++) {
    long long sum = 0;
    for (int(j) = 0; (j) < n; (j)++) {
      sum += abs(a[j] - i) - 1;
      if (a[j] == i) sum++;
    }
    if (sum < mn) {
      mn = sum;
      t = i;
    }
  }
  cout << t << " " << mn;
  return 0;
}
