#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=(a); i<(n); i++)
#define rep2(i,a,n) for (int i=(a); i<=(n); i++)
using ll = long long;
using dl = double long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
int main() {
  vector<int> l(3);
  rep(i,0,3) cin >> l[i];
  sort(l.begin(),l.end());
  cout << l[1]+l[2] << endl;
}
#include<iostream>

using namespace std;

int main(){
    int A[4];
    for(int i = 0; i < 4; i++){
        cin >> A[i];
    }
    cout << A[0] * A[3] - A[1] * A[2] << endl;
}