#include<bits/stdc++.h>
#define int long long int
#define debug(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fastm_fast ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL)
#define pb push_back 
#define mp make_pair
#define ff first
#define ss second
using namespace std;
const int  mod = 1e9 + 7;
const int MAX = 2e5+5;
typedef pair<int, int> pii;
typedef vector<int> vi ;
typedef vector<string> vs;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef map<int,int> mapii ;

void sujho(){
    int a ,b ,c; 
    cin >> a >> b >> c ;

    if( a==b ) cout << c ;
    else if(a == c) cout << b ;
    else if(b == c) cout << a ;

    else cout << 0;
    
    


}
int32_t main()
{
 fastm_fast;
//  int test;cin >> test;
//  for(int i = 1; i <= test; i++)
 { //cout << "Case #"<< test << ":";
     sujho();
 }
 return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn=1e6+5;
int main() {
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<b-c<<endl;
    return 0;
}