inp = raw_input() nrs = inp.split(' ') nrs = sorted([int(i) for i in nrs]) # print nrs print nrs[0] * nrs[1] + nrs[2] * nrs[3]