#include<bits/stdc++.h>
using namespace std;
typedef long long ll; typedef double db;
typedef pair<int, int> pii; typedef pair<ll, ll> pll;
typedef vector<int> vi; typedef vector<ll> vl;
typedef vector<pii> vpii; typedef vector<pll> vpll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define FOR0(n) for(int i=0;i<n;++i)
#define FOR1(n) for(int i=1;i<=n;++i)
ll gcd(ll a, ll b) { return a % b ? gcd(b, a % b) : b; }
const ll mod = 1e9 + 7; const ll inf = 0x3f3f3f3f;
ll qpow(ll a, ll b) { ll t = 1; while (b != 0) { if (b & 1)t = (t * a) % mod; a = (a * a) % mod; b >>= 1; }return t; }
template <typename T>
void re(T& a) { for (auto& t : a)cin >> t; }
template <typename T>
void pr(T& a) { for (auto& t : a)cout << t << "  "; cout << endl; }

void solve() {
	vi a(3);
	re(a);
	sort(a.begin(), a.end());
	if (a[0] == a[1])cout << a[2];
	else if (a[1] == a[2])cout << a[0];
	else cout << 0;
}

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int T = 1;
	//cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
#define rep(i, a, b) for (int i = a; i < (int)(b); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }


int main() {
    int a, b, c;
    cin >> a >> b >> c;
    int ans;
    if(a==b) ans = c;
    else if(b==c) ans = a;
    else if(c==a) ans = b;
    else ans = 0;
    
    cout << ans << endl;
    
    return 0;
}
