#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  float s, p;
  int arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  if (n == 2) {
    s = (arr[0] + arr[1]);
    p = s / 2;
    cout << p;
  } else {
    sort(arr, arr + n);
    s = (arr[n - 3] + arr[n - 2]) / 2;
    p = (s + arr[n - 1]) / 2;
    cout << p;
  }
}
