#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
vector<int> v = {0,0,1,1,1,1,1,4,5};
auto it = upper_bound(v.begin(), v.end(), 1);
std::cout << std::distance( std::begin(v), it ) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICB2ZWN0b3I8aW50PiB2ID0gezAsMCwxLDEsMSwxLDEsNCw1fTsKICAgIGF1dG8gaXQgPSB1cHBlcl9ib3VuZCh2LmJlZ2luKCksIHYuZW5kKCksIDEpOwogICAgICAgIHN0ZDo6Y291dCA8PCBzdGQ6OmRpc3RhbmNlKCBzdGQ6OmJlZ2luKHYpLCBpdCApIDw8IHN0ZDo6ZW5kbDsKICAgIHJldHVybiAwOwp9