#include <bits/stdc++.h>
int main(void) {
  int N;
  int v[50];
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &v[i]);
  }
  int length = sizeof(v) / sizeof(int);
  int step, i, j;
  for (step = length / 2; step > 0; step /= 2) {
    for (i = step; i < length; i++) {
      int tmp = v[i];
      int j = i;
      for (j = i; j >= step; j -= step) {
        if (v[j - step] > tmp) {
          v[j] = v[j - step];
        } else {
          break;
        }
      }
      v[j] = tmp;
    }
  }
  int sum = (v[0] + v[1]) / 2;
  if (N >= 3) {
    for (int i = 2; i < N - 1; i++) {
      sum = (sum + v[i]) / 2;
    }
  }
  printf("%d", sum);
}
