s=input() s=s.split(' ') maxx=0 if int(s[0])*int(s[1])+int(s[2])*int(s[3])>maxx: maxx=int(s[0])*int(s[1])+int(s[2])*int(s[3]) if int(s[0])*int(s[2])+int(s[1])*int(s[3])>maxx: maxx=int(s[0])*int(s[2])+int(s[1])*int(s[3]) if int(s[0])*int(s[3])+int(s[1])*int(s[2])>maxx: maxx=int(s[0])*int(s[3])+int(s[1])*int(s[2]) print(maxx)