<?php
while ($line = fgets(STDIN)) {
 $array[] = trim($line);
}
$a = $array[0];
$b = $array[1];
$num = explode(' ',$b);
  rsort($num);
  $p = $num[0];
  $q = $num[1];
  $r = $num[2];

  if(($a >= 2 )&&($a <= 50 )&&($p <= 1000)){
    if($a == 2){
      $sum = $p + $q;
      $Ans = $sum / 2;
      echo $Ans;
    }else{
      $sum1 = $r + $q;
      $Ans1 = $sum1 / 2;
      $sum2 = $p + $Ans1;
      $Ans = $sum2 / 2;
      echo $Ans;
      
    }

    
  }
?>
