#include #include using namespace std; using ll = long long; int main() { int b, p = 0, res = 0; for (int i = 0; i < 9; i++) { scanf("%d", &b); if (p + 1 != b) res = p + 1; p = b; } printf("%d\n", res); }