''' Created on 30.01.2014 @author: Florescu ''' lin = str(raw_input()).split() lin.sort() print int(lin[0])*int(lin[1])+int(lin[2])*int(lin[3])