#include<stdio.h>
#include<set>
#include<vector>
#include<unordered_map>
#include<algorithm>
#include<cstring>

using namespace std;

int a,b,c,d;

int main () {
	
	#ifndef ONLINE_JUDGE
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
	#endif
	
	scanf("%d %d %d %d",&a,&b,&c,&d);
	
	int sol = 0;
	sol = max(sol,a*b+c*d);
	sol = max(sol,a*c+b*d);
	sol = max(sol,a*d+b*c);
	
	printf("%d\n",sol);
	
	return 0;
}