fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map(String::toDouble)
    val sorted_A = A.sortedDescending()
    val list = mutableListOf<Double>()
    var j = 2
    if (N >= 3){
        for(i in 0..N-3){
            list.add(sorted_A[i]/j)
            j *= 2
        }
    }
    list.add(sorted_A[N-1]/(j))
    if(N>=2)
        list.add(sorted_A[N-2]/(j))
    println(list.sum())
}