// #define _GLIBCXX_DEBUG #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) int main() { // Input And Output int x = 1; rep(i, 9) { int B; cin >> B; if (B == x) ++x; else { cout << x << endl; return 0; } } }