N = int(input()) x = [int(i) for i in input().split()] x.sort() for i in range(N-1): x[i] = max(x)+int(x[i]/2) print(max(x))