#include "bits/stdc++.h" using namespace std; int main() { int x, ans = 10; for (int i = 1; i < 10; i++) { cin >> x; if (ans == 10 && x != i) ans = i; } cout << ans; }