#include using namespace std; int main(){ int n = 1; int i; while(1){ cin >> i; if( !( i == n ) ){ break; } n++; } cout << n << endl; return 0; }