#include <bits/stdc++.h>
using namespace std;
int a[1100];
int main() {
  int n;
  int ans = 0, mn1 = 1000000, mn2 = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= 100; i++) {
    ans = 0;
    for (int j = 0; j < n; j++) {
      if (abs(a[j] - i) > 1) ans += abs(a[j] - i) - 1;
    }
    if (ans < mn1) {
      mn2 = i;
      mn1 = ans;
    }
  }
  printf("%d %d\n", mn2, mn1);
  return 0;
}
