#include <bits/stdc++.h>
using namespace std;
const int MAX_CHARS = 26;
void swap(int *x, int *y) {
  int temp = *x;
  *x = *y;
  *y = temp;
}
bool check(int freq[], int k) {
  for (int i = 0; i < MAX_CHARS; i++)
    if (freq[i] && freq[i] != k) return false;
  return true;
}
int main() {
  string s;
  int n, m, k, coun = 0, l, r, mn = INT_MAX, mx = INT_MIN;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int t1 = 1;
  for (int t = 1; t <= 100; t++) {
    int sum = 0;
    for (int i = 0; i < n; i++) sum += max(abs(a[i] - t) - 1, 0);
    if (sum < mn) {
      mn = sum;
      t1 = t;
    }
  }
  cout << t1 << " " << mn;
}
