#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; const int INF = 1000000000; // 10^9 int main() { const int N = 9; vector v(N); rep(i, N) cin >> v[i]; for (int i = 0; i < N; i++){ int x = v[i]; x--; if(x != i) { cout << x << endl; return 0; } } }