#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
template <class K> using mset = __gnu_pbds::tree<K, __gnu_pbds::null_type, less_equal<K>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
mset<int> ms; //multiset
int main() {
ms.insert(-1);
ms.insert(1);
ms.insert(1);
ms.insert(3);
ms.insert(3);
ms.insert(5);
ms.insert(5);
//ms.order_of_key(x) = # of values < x
cout << ms.order_of_key(1) << endl; //# values < 1
cout << ms.order_of_key(3) << endl; //# values < 3
cout << ms.order_of_key(5) << endl; //# values < 5
cout << ms.order_of_key(6) << endl; //# values < 6
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNpbmNsdWRlIDxleHQvcGJfZHMvYXNzb2NfY29udGFpbmVyLmhwcD4KdGVtcGxhdGUgPGNsYXNzIEs+IHVzaW5nIG1zZXQgPSBfX2dudV9wYmRzOjp0cmVlPEssIF9fZ251X3BiZHM6Om51bGxfdHlwZSwgbGVzc19lcXVhbDxLPiwgX19nbnVfcGJkczo6cmJfdHJlZV90YWcsIF9fZ251X3BiZHM6OnRyZWVfb3JkZXJfc3RhdGlzdGljc19ub2RlX3VwZGF0ZT47Cm1zZXQ8aW50PiBtczsgLy9tdWx0aXNldAppbnQgbWFpbigpIHsKCW1zLmluc2VydCgtMSk7Cgltcy5pbnNlcnQoMSk7Cgltcy5pbnNlcnQoMSk7Cgltcy5pbnNlcnQoMyk7Cgltcy5pbnNlcnQoMyk7Cgltcy5pbnNlcnQoNSk7Cgltcy5pbnNlcnQoNSk7CgkvL21zLm9yZGVyX29mX2tleSh4KSA9ICMgb2YgdmFsdWVzIDwgeAoJY291dCA8PCBtcy5vcmRlcl9vZl9rZXkoMSkgPDwgZW5kbDsgLy8jIHZhbHVlcyA8IDEKCWNvdXQgPDwgbXMub3JkZXJfb2Zfa2V5KDMpIDw8IGVuZGw7IC8vIyB2YWx1ZXMgPCAzCgljb3V0IDw8IG1zLm9yZGVyX29mX2tleSg1KSA8PCBlbmRsOyAvLyMgdmFsdWVzIDwgNQoJY291dCA8PCBtcy5vcmRlcl9vZl9rZXkoNikgPDwgZW5kbDsgLy8jIHZhbHVlcyA8IDYKCXJldHVybiAwOwp9