# coding: utf-8
from statistics import median
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = A[0]
top = -1
for i in range(N-1):
    ans += A[i+1] - A[i]
    top = max([top, A[i+1] - A[i], (A[i+1] - A[i])*2])
print(ans - top//4)