import java.util.Scanner; public class prog { public static void main(String[] args) { Scanner input = new Scanner(System.in); int[] a = new int[4]; a[0] = input.nextInt(); a[1] = input.nextInt(); a[2] = input.nextInt(); a[3] = input.nextInt(); int temp = 0; for (int i = 0; i < 3; i++){ if (a[i] < a[i+1]){ temp = a[i]; a[i] = a[i+1]; a[i+1] = temp; } } System.out.println(a[0]*a[1]+a[2]*a[3]); } }