#include <bits/stdc++.h>
using namespace std;
int a[100005];
int n;
int r[100005];
int judge(int x) {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] != x) {
      ans += abs(x - a[i]) - 1;
    }
  }
  return ans;
}
int solve(int l, int r) {
  while (r - l > 0) {
    int mid = (r + l) / 2;
    int flag1, flag2, flag3;
    flag2 = judge((mid + r) / 2);
    flag3 = judge((mid + l) / 2);
    if (flag2 < flag3)
      l = mid;
    else
      r = mid;
  }
  return l;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    sort(a, a + n);
    int flag = 0;
    int l = 1, r = 100;
    int Min = 0x3ffffff;
    for (int i = 1; i < 100; i++) {
      if (judge(i) < Min) {
        flag = i;
        Min = judge(i);
      }
    }
    printf("%d %d\n", flag, Min);
  }
  return 0;
}
