#include <bits/stdc++.h>
int main() {
  int N = 0;
  std::cin >> N;
  std::vector<float> nums;
  for (int i = 0; i < N; ++i) {
    int value = 0;
    std::cin >> value;
    nums.push_back(value);
  }
  std::sort(nums.begin(), nums.end());
  if (nums.size() == 2) {
    float avg = (nums[0] + nums[1]) / 2;
    std::cout << avg << std::endl;
  } else {
    float highestAvg = (nums[nums.size() - 2] + nums[nums.size() - 3]) / 2;
    float highestPossible = (highestAvg + nums[nums.size() - 1]) / 2;
    std::cout << highestPossible << std::endl;
  }
}
