def getlist(): return list(map(int, input().split())) S = getlist() S = sorted(S) ans = (sum(S) - S[0] - S[5]) / 4 print(ans)