def main(): L1, L2, L3 = map(int, input().split()) cycle_num = list(map(int, input().split())) cycle_length = [2*(L2+L3), 2*(L3+L1), 2*(L1+L2)] cycle_num.sort() cycle_length.sort(reverse=True) print(sum(num * length for num, length in zip(cycle_num, cycle_length))) if __name__ == "__main__": main()