object Main extends App {
  val input1 = readInt
  // this list need to be sorted
  val input2 = readLine.split(" ").take(input1).map(_.toInt).sorted

  var result: Double = 0

  if(input1 % 2 == 0){
    for(x <- 0 until input1/2){
      result += (input2(x) + input2(input1 - 1 - x))/2.0
    }
  } else if(input1 % 2 == 1){
    for(x <- 0 until (input1 - 1)/2){
      result += (input2(x) + input2(input1 - 1 - x))/2.0
      result += (input1 / 2) + 1
    }
  }

  println(result)
  
}
