#include "bits/stdc++.h"
using namespace std;
#define endl "\n"
#define endly " "
#define int long long
#define sz(x) ((int)x.size())
#define len(x) ((int)x.length())
#define ff first
#define ss second
#define all(x) begin(x), end(x)
#define tc() int test; cin>>test; while(test--)
#define pii pair<int,int>

int32_t main()
{
      ios::sync_with_stdio(false);
      cin.tie(0); 
      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;

#define ll long long int
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define each(x,v) for(auto& (x) : (v))
#define f(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define b(i,a,b) for(ll i=(ll)(a);i>=(ll)(b);i--)
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define mp make_pair
#define mem(mat,f) memset(mat, f, sizeof(mat))
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define make(a,n) ll *a=new ll[n]();
#define maxq(x) priority_queue<x>
#define minq(x) priority_queue<x,vector<x>,greater<x>>
#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
const ll INF = 1LL << 60;

bool isSquare(long double x){
    if (x >= 0) {
        long long sr = sqrt(x);
        return (sr * sr == x);
    }
    return false;
}

int countDigit(long long n){
    if (n == 0)
        return 0;
    return 1 + countDigit(n / 10);
}

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

inline ll max(ll a1,ll a2){
    if(a1>a2){
        return a1;
    }else{
        return a2;
    }
}

inline ll min(ll a1,ll a2){
    if(a1<a2){
        return a1;
    }else{
        return a2;
    }
}

/*int multiply(int x, int res[], int res_size) {
int carry = 0;
for (int i = 0; i < res_size; i++) {
    int prod = res[i] * x + carry;
    res[i] = prod % 10;
    carry = prod / 10;
}
while (carry) {
    res[res_size] = carry % 10;
    carry = carry / 10;
    res_size++;
}
return res_size;
}
ll power(int x, int n){
if(n == 0 ){
    return 1;
}
int res[100000];
int res_size = 0;
int temp = x;
while (temp != 0) {
    res[res_size++] = temp % 10;
    temp = temp / 10;
}
for (int i = 2; i <= n; i++)
    res_size = multiply(x, res, res_size);
ll ans=0;
for (int i = res_size - 1; i >= 0; i--)
    ans=((ans*10)%mod+res[i]%mod)%mod;
return ans%mod;
}*/

ll multiply(ll x, ll res[], ll res_size)
{
    ll carry = 0;

    for (ll i=0; i<res_size; i++)
    {
        ll prod = res[i] * x + carry;
        res[i] = prod % 10;  
        carry  = prod/10;    
    }

    while (carry)
    {
        res[res_size] = carry%10;
        carry = carry/10;
        res_size++;
    }
    return res_size;
}
ll fact(ll n)
{
    ll res[50005];

    res[0] = 1;
    ll res_size = 1;

    for (ll x=2; x<=n; x++)
    {
        res_size = multiply(x, res, res_size);
    }
    ll a=0;
    for (ll i=res_size-1; i>=0; i--){
        a=((a*10)%mod+res[i])%mod;
    }
    return a%mod;
}

ll pf[505];

void primeFactors(ll n){
    while (n % 2 == 0)
    {   
        pf[2]++;
        n = n/2;
    }
    for (ll i = 3; i <= sqrt(n); i = i + 2)
    {
        while (n % i == 0)
        {
            pf[i]++;
            n = n/i;
        }
    }
    if (n > 2)
        pf[n]++;
}

class node{
public:
    int s;
    int e;
    int p;
};

bool compare(node a1,node a2){

    return a1.e<a2.e;
}

//////////////////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////////////////



int main(){

    fast;

    ll a,b,c;
    cin>>a>>b>>c;

    if(a==b){
        cout<<c<<endl;
    }
    else if(b==c){
        cout<<a<<endl;
    }
    else if(a==c){
        cout<<b<<endl;
    }else{
        cout<<"0"<<endl;
    }
    

return 0;
}