#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define print(x) cout << x << endl;
using namespace std;
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    vector<int> B(9);
    REP(i, 9){
        cin >> B[i];
    }
    sort(B.begin(), B.end());
    
    REP(i, 10){
        if((i+1) != B[i]){
            print(i+1);
            break;
        }
    }
    return 0;
}