# -*- coding: utf-8 -*- import numpy L = map(int, raw_input().split()) # length C = map(int, raw_input().split()) # color S = sorted(2 * numpy.array([L[0] + L[1], L[1] + L[2], L[2] + L[0]])) C = sorted(C) ret = 0 for i in xrange(3): ret += S[i] * C[2 - i] print ret