#include <iostream.h>
using namespace std;

#define swap(type,x,y) do{type t = x;x = y;y = t} while(0)

void bubble(int a[],int n);
int bin_search(int a[], int num,int key);

int main(){
  int N;	
  int sum = 0;
  cin >> N;
 
  int a[N];
  for(int i = 0;i < N;i++){
  	cin >> a[i];
    sum += a[i];
  }
  float avr = sum / N;
  
  bubble(a,N);
  cout << bin_serach(a,N,avr) << \n;
  
  return 0;
}

void bubble(int a[],int n){
  int j,k;
  for(j = 0;j < n-1;n++){
  	for(k = n-1;k > j;k--){
      if(a[k-1] > a[k])
        swap(int,a[k-1],a[k]);
    }
  }
}

int bin_search(int a[], int num,int key){
  int pc = 0;
  int pr = num-1;
  int tmp,disc;
  int min = 100;
  do{
    disc = a[pc] - key;
    if(min > disc) {
      min = disc;
      tmp = a[pc];
    }
    pc++;
  }while(pc <= pr);
  return tmp;
}