#include using namespace std; int main() { int i=0, b, ans; do { cin >> b; i++; if (b == 9) i =10; } while (b == i); cout << i; return 0; }