<?php
  
 	fscanf(STDIN, "%d", $num);
	$tmp = explode(" ",fgets(STDIN));

	while(count($tmp) > 1){
      $a = array_pop($tmp);
	  $b = array_pop($tmp);
	  $tmp[] = ($a + $b) / 2;
      rsort($tmp);
    }
	echo $tmp[0];

  
  
  ?>