#include <bits/stdc++.h>

#define Fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using ll = long long ;
using namespace std;
using pii = pair<int,int>;
#define ld long double
#define bit(mask,i) ((mask>>i)&1)
#define p(a) cout<<"("<<a.first<<" "<<a.second<<") ";
#define row vector<ll>
#define vll row
#define mtx vector<row>
#define oo 1e9+9
#define INF oo
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
using namespace std;
const int N = 2e5 + 5;
ll mod=998244353;

ll dp[5000+5][5000+5];
int main()
{
    ll tcc=1;
    //cin>>tcc;
    while(tcc--){
       ll a,b,c,d;
       cin>>a>>b>>c>>d;
       ll ans=a*d-b*c;
       cout<<ans<<"\n";
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long ;

int main()
{
 int a,b,c,d;
 cin>>a>>b>>c>>d;
 
 cout<<min({a,b,c,d}) <<endl;






}
