
/*
....................../´¯/)
....................,/¯../
.................../..../
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯\
........('(...´...´.... ¯~/'...')
.........\.................'...../
..........''...\.......... _.·´
............\..............(
..............\.............\...
*/


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <climits>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define ye cout<<"YES"
#define no cout<<"NO"
#define ln cout<<"\n";
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define pi 3.14159265358979323846
#define MOD 1000000007
// cout<<"Case #"<<ts<<": “;
//priority_queue < pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> pq;


using namespace std;

ll mod(ll x, ll m) {
	return (x % m + m) % m;
}

ll gcd(ll a , ll b)
{
	if (b == 0) return a;
	a %= b;
	return gcd(b, a);
}

ll fast_exp(ll base, ll exp) {
	ll res = 1;
	while (exp > 0) {
		if (exp % 2 == 1) res = (res * base) % MOD;
		base = (base * base) % MOD;
		exp /= 2;
	}
	return res % MOD;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll t = 1, r, n, a, d, c, b, x, y, sum, cnt, i, j, k, m, l, q, maxx, minn, temp, ans, flag, g, ts;
	ll mod = 1000000007;
	char ch, chh;
	double dans;
	string str, ttr;

	//cin >> t;


	for (ts = 1; ts <= t; ts++)
	{
		flag = 0; sum = 0; cnt = 0; ans = 0; k = 0; maxx = 0; minn = 0; a = 0; b = 0; temp = 0;

		n = 4;
		ll arr[4]; for (i = 0; i < n; i++) {cin >> arr[i];}
		sort(arr, arr + n);
		cout << arr[0];






		ln
	}
	return 0;
}

#include <algorithm>
#include <iostream>
#include <list>
#include <numeric>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <iterator>
#include <ostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <queue>
#include <cstdio>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; ++i)
#define repn(i, n) for(int i = 1; i <= n; ++i)

typedef long long ll;

template<class T> string toString(T n){ostringstream ost;ost<<n;ost.flush();return ost.str();}

#define all(t) t.begin(), t.end()
#define INF 1000000000

typedef vector<int> vi;
typedef vector<long long> vl;

template<class T> inline void check_min(T &a,T b){if(b<a) a=b;}
template<class T> inline void check_max(T &a,T b){if(b>a) a=b;}

string s;
int a, b, c;

int main() {
    ios::sync_with_stdio();
    cin.tie(0);
    cin>>a>>b>>c;
    if(a == b)cout<<c<<endl;
    else if(a == c)cout<<b<<endl;
    else if(b == c)cout<<a<<endl;
    else cout<<0<<endl;
    return 0;
}

