#include #include #include #include #include #include #include #include #include using namespace std; using ll = long long int; #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define YES(n) std::cout << ((n) ? "YES" : "NO" ) << "\n"; #define Yes(n) std::cout << ((n) ? "Yes" : "No" ) << "\n"; #define ALL_INCLUDED_ENVIRONMENT template class C> std::ostream& operator<<(std::ostream& o, const C& v) { o << "{"; bool init = 1; for (auto e : v) { if (init) { init = 0; } else { o << ", "; } o << e; } o << "}"; return o; } int int_width (ll x) { int ans = 0; while(x > 0) { x = x >> 1; ans++; } return ans; } int popcnt(uint64_t n) { return __builtin_popcountll(n); } int tzcnt(uint64_t n) { return n == 0 ? 64 : __builtin_ctzll(n); } int lzcnt(uint64_t n) { return n == 0 ? 64 : __builtin_clzll(n); } int main() { // cin.tie(0); // ios::sync_with_stdio(false); ll n; cin >> n; ll ans = int_width(n); if (popcnt(n) == 1) ans--; cout << ans << "\n"; return 0; }