#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define F first
#define S second
#define YES(n)cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define _GLIBCXX_DEBUG
const ll INF = 1e12;
int main(){
    int a,b,c;
    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;
}
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double lf;

#define rep(i, f, t) for (int i = (f), ed##i = (t); i <= ed##i; ++i)
#define re(i, t) rep (i, 1, t)
#define per(i, t, f) for (int i = (t), ed##i = (f); i >= ed##i; --i)
#define ste(i, f, t, s) for (int i = (f), ed##i = (t); i <= ed##i; i += s)
#define each(i, x) for (auto &i : (x))
#define nx(i, f) for (int i = h[f]; i; i = e[i].n)
#define nxt(i, f, g) for (int i = g.h[f]; i; i = g.e[i].n)
#define dbg(x) (cerr << "(dbg) " << #x " = " << (x) << '\n')
#define fio(x) (freopen(x ".in", "r", stdin), freopen(x ".out", "w", stdout))
#define y1 y1__
#define umod(x) ((x) >= mo && ((x) -= mo))
#define outl(x) (cout << (x) << '\n')
#define outs(x) (cout << (x) << ' ')
#define errl(x) (cerr << (x) << '\n')
#define errs(x) (cerr << (x) << ' ')

// clang-format off
template<class T>T jdz(const T&a){return a>0?a:-a;}
template<class T,class E>void up(T&a,const E&b){a<b&&(a=b);}
template<class T,class E>void down(T&a,const E&b){b<a&&(a=b);}
template<class T,size_t E>void fill(T(&a)[E],const int&x){memset(a,x,E*sizeof(*a));}
ll pow(ll a,ll b,const ll&m){ll res=1;a%=m;while(b>0){if(b&1)res=res*a%m;a=a*a%m,b>>=1;}return res;}
ll gcd(ll a,ll b){ll t;while(b!=0)t=a%b,a=b,b=t;return a;}
ll C(ll n,ll m){if(m>n)return 0;ll a=1;re(i,m)a*=(n-i+1),a/=i;return a;}
ll C(ll n,ll m,ll p){if(m>n)return 0;ll x=1;re(i,m){ll a=(n+i-m)%p,b=i%p;x=x*(a*pow(b,p-2,p)%p)%p;}return x;}
// clang-format on


signed main() {
	int a[10];
	re(i,3)cin>>a[i];
	sort(a+1,a+3+1);
	if(a[1]==a[2])cout<<a[3];
	else if(a[2]==a[3])cout<<a[1];
	else cout<<0;
	return 0;
}