#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
	// your code goes here
	ll a,b,c;cin>>a>>b>>c;
	if(a==b)cout<<c;
	else if(b==c)cout<<a;
	else if(a==c)cout<<b;
	else if(a==b&&b==c)cout<<a;
	else cout<<"0";
	return 0;
}
//  “Alhamdulillah for Everything”

#include<bits/stdc++.h>
using namespace std;

//---------DEFINES------------
#define      pai              acos(-1)
#define      ff               first
#define      ss               second
#define      ll               long long
#define      pb               push_back
#define      mp               make_pair
#define      pll              pair<ll,ll>
#define      sz(a)            (ll)a.size()
#define      endl             "\n"
#define      sline(s)         getline(cin,s);
#define      gcd(a, b)        __gcd(a, b)
#define      lcm(a, b)        ((a*b)/gcd(a,b))
#define      all(sob)         sob.begin(),sob.end()
#define      ms(a, b)         memset(a,b,sizeof(a))
#define      rep(i,b,n)       for(ll i = b;i <= n; i++)
#define      rev(i,b,n)       for(ll i = b;i >= n; i--)
#define      setp(x)          cout<<fixed<<setprecision(x)
#define      watch(x)         cout<<(#x)<<" = "<<(x)<<'\n'
#define      TEST_CASE(t)     for(ll zz=1;zz<=t;zz++)
#define      PRINT_CASE       cout<<"Case "<<zz<<": ";
#define      fii              freopen("input.txt","r",stdin);
#define      foo              freopen("output.txt","w",stdout);
#define      ActioN           ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

//-------CONSTANTS------------
const        ll               mod = 1e9+7;
const        ll               mxn = 1e5+7;
const        ll               inf = 1e18;

//------MOD-FUNCTIONS---------
inline      void              normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline       ll               modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline       ll               modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline       ll               modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline       ll               modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline       ll               modInverse(ll a) { return modPow(a, mod - 2); }
inline       ll               modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }



int  main()
{
    //Light_Camera:)
    ActioN;
    ll i,j,k,a,b,c,d,n,m,t,u,v,w,x,y,z;
    vector<ll>vec(3);
    for(i=0;i<3;i++)
    {
        cin>>vec[i];
    }
    sort(all(vec));
    a=vec[0];
    b=vec[1];
    c=vec[2];
    if(a==b)
    {
        cout<<c<<endl;
    }
    else if(b==c)
    {
        cout<<a<<endl;
    }
    else
    {
        cout<<0<<endl;
    }
    return 0;
}
