#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int n, a[1001], min = 1000000, ans;
  cin >> n;
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  long long int t;
  for (t = 1; t <= 100; t++) {
    long long int sum = 0;
    for (long long int i = 1; i <= n; i++) {
      if (a[i] < t - 1) sum += t - 1 - a[i];
      if (a[i] > t + 1) sum += a[i] - t - 1;
    }
    if (sum < min) {
      min = sum;
      ans = t;
    }
  }
  cout << ans << ' ' << min;
  return 0;
}
