#include <bits/stdc++.h>

using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b)
    cout << c << endl;
  else if(b == c)
    cout << a << endl;
  else if(c == a)
    cout << b << endl;
  else 
    cout << 0 << endl;
}
// /*
// power code taken from geeks for geeks
// */
// cout << setprecision (2) << fixed << 1.2;

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;

// THINGS TO REMEMBER
// ENDL is slow, '\n' is fast
// Clear everything (including graphs) between test cases
// use anti-anti-hash: https://codeforces.com/blog/entry/62393
// pb-ds: https://codeforces.com/blog/entry/11080
// check when to use LLONG_MAX/LLONG_MIN vs INT_MAX or INT_MIN
// You frequently suffer from confirmation bias - you trust your initial solution and miss simple things. 
// When you hit a roadblock, remember to rethink the solution ground up, not just try hacky fixes


#define PLL pair<ll, ll>
#define en endl

const ll INF = 1e18 + 5;
const ll MAX_N = 1e5 + 5;
const ll MODD = 1e9 + 7;
const ll BITS = 10;

ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
double max(double a,double b){return a>b?a:b;}
double min(double a,double b){return a<b?a:b;}

ll modd(ll a){if(a<0LL) return a*-1LL;return a;}
double modd(double a){if(a<0.0) return a*-1.0;return a;}

ll modulo(ll a){return (a + MODD) % MODD; }

void swap(ll &a, ll &b) {
    ll t = a;
    a = b;
    b = t;
}

ll power(ll k, ll p){
    if (p == 0)
        return 1LL;
 
    ll P = power(k, p/2LL);
    P = (P * P) % MODD;
 
    if (p % 2 == 1)
        P = (P * k) % MODD;
 
    return P;
}
int iii = 0;void _debug() {cout << "here " << (iii++) << endl;}

void solve() {
    ll a1, a2, a3, a4;
    cin >> a1 >> a2 >> a3 >> a4;
    cout << min({a1, a2, a3, a4}) << endl;
}


int main(){

    



    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    

    // init();

    ll t=1;


    // cin >> t;
    


    for(ll i = 0; i < t; i++) {
        
        // cout << "---------------case " << i + 1 << endl;

        // cout << "Case #" << i + 1 << ": ";
        
        // cout << endl;

        solve();
    }

    return 0;
}