N = int(eval(input()))

P = sorted([int(eval(input())) for x in range(N)])



m = P[N-1]

P = P[:N-1]

print((sum(P) + m // 2))
N = int(eval(input()))

m, *P = sorted([int(eval(input())) for x in range(N)], reverse=True)



"""

m = P[N-1]

P = P[:N-1]

"""



print((sum(P) + m // 2))
N = int(eval(input()))
P = sorted([int(eval(input())) for x in range(N)])
m = P[N - 1]
P = P[: N - 1]
print((sum(P) + m // 2))

N = int(eval(input()))
m, *P = sorted([int(eval(input())) for x in range(N)], reverse=True)
"""
m = P[N-1]
P = P[:N-1]
"""
print((sum(P) + m // 2))

-P = sorted([int(eval(input())) for x in range(N)]) -m = P[N - 1] -P = P[: N - 1] +m, *P = sorted([int(eval(input())) for x in range(N)], reverse=True) +""" +m = P[N-1] +P = P[:N-1] +"""