#include <bits/stdc++.h>
const long long MOD = 1e9 + 7;
using namespace std;
long long fact(long long n) {
  long long f = 1;
  for (long long i = 2; i <= n; i++) f *= i;
  return f;
}
long long ncr(long long n, long long r) {
  return fact(n) / (fact(r) * fact(n - r));
}
long long isPrime(long long n) {
  if (n <= 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return 0;
  return 1;
}
long long isVowel(char s) {
  if (s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u')
    return 1;
  else
    return 0;
}
long long fib(long long n) {
  if (n < 2) return n;
  return fib(n - 1) + fib(n - 2);
}
long long isEven(char a) {
  if (a == '2' || a == '4' || a == '6' || a == '8' || a == '0')
    return 1;
  else
    return 0;
}
long long is_distinct(long long n) {
  long long c = 0;
  set<long long> se;
  while (n > 0) {
    long long d = n % 10;
    se.insert(d);
    c++;
    n /= 10;
  }
  if (se.size() == c)
    return 1;
  else
    return 0;
}
long long lar_prime(long long n) {
  for (long long i = n; i >= 2; i--) {
    if (n % i == 0 && isPrime(i) == 1) return i;
  }
}
long long isSub(string s, string t) {
  for (long long i = 0; i < s.size(); i++) {
    string z = s.substr(i, t.size());
    if (z == t) return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long ans = 0, best = MOD, t;
  for (long long i = 0; i < 101; i++) {
    ans = 0;
    for (long long j = 0; j < n; j++) {
      if (abs(i - v[j]) > 1) ans += (abs(i - v[j])) - 1;
    }
    if (ans <= best) {
      best = ans;
      t = i;
    }
  }
  cout << t << " " << best;
  return 0;
}
