#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a)  (a).begin(),(a).end()

int main(){
    vector<int> A(3);
    cin >> A[0] >> A[1] >> A[2];
    sort(ALL(A));
    if (A[0] == A[2]){
        cout << A[0] << endl;
    } else {
        if ((A[0] == A[1]) || (A[1] == A[2])){
            if (A[0] == A[1]){
                cout << A[2] << endl;
            } else {
                cout << A[0] << endl;
            }
        } else {
            rep(i, 4){
                if (A[i] != i){
                    cout << i << endl;
                    return 0;
                }
            }
        } 

    }
}