#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> v;
  int tmp;
  cin >> n;
  cin.ignore();
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    v.push_back(tmp);
  }
  sort(v.begin(), v.end());
  double ans = 0;
  for (int i = 0; i < n - 1; i++) {
    ans += ((double)(v[i] + v[i + 1])) / 2;
  }
  cout << ans << endl;
  return 0;
}
