#include <bits/stdc++.h>
using namespace std;
int l, r, m, n, a[1005], sum, minn, t;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  l = 2, r = 99, sum = 0, minn = 1000000, t = 0;
  for (; l <= r; ++l) {
    sum = 0;
    for (int i = 1; i <= n; ++i)
      sum += min(min(abs(a[i] - l + 1), abs(a[i] - l - 1)), abs(a[i] - l));
    if (sum < minn) {
      minn = sum;
      t = l;
    }
  }
  printf("%d %d", t, minn);
  return 0;
}
