import java.util.*

fun main(args: Array<String>) {
    val argList = Scanner(System.`in`)

    val n = argList.nextLine().toInt()
    val a = argList.nextLine().split(" ").map { it.toFloat() }

    val e = Alchemist()
    e.execute(n, a)

}

class Alchemist {
    fun execute(n: Int, a: List<Float>) {
        val result = mutableListOf<Float>()
        val sorted = a.sorted()

        composite(sorted, result)
        println(result[0])
    }

    private fun composite(sorted: List<Float>, result: MutableList<Float>) {
        if (sorted.size <= 2) {
            result.add((sorted[0] + sorted[1]) / 2)
            return
        }
        val calculated = (sorted[0] + sorted[1]) / 2
        val p = sorted.filterIndexed { index, _ ->  index != 0 }.filterIndexed { index, _  -> index != 1 }

        val sortedWithout = (p + calculated).sorted()

        composite(sortedWithout, result)
    }
}