#include /** * A standard practice in competitive programming for performance, * although not strictly necessary for a single input. */ void setup_io() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); } int main() { setup_io(); // The input 'n' can be up to 10^18, so we must use a 64-bit integer type. long long n; std::cin >> n; // --- Step 1: Calculate the minimum number of bits required to store n. --- // This is equivalent to finding the length of the binary representation of n. // For any positive integer, this can be calculated by counting how many times // we can divide it by 2 until it becomes 0. // The problem guarantees 1 <= n, so we don't need a special case for n = 0. int min_bits = 0; long long temp_n = n; while (temp_n > 0) { // Right-shifting by 1 is an efficient way to perform integer division by 2. temp_n >>= 1; min_bits++; } // --- Step 2: Find the smallest power of two 'b' such that b >= min_bits. --- // We can start with b = 1 and repeatedly multiply by 2 until it's large enough. int b = 1; while (b < min_bits) { // Left-shifting by 1 is an efficient way to multiply by 2. b <<= 1; } // --- Step 3: Print the final result with the correct pluralization. --- std::cout << b; if (b == 1) { std::cout << " bit" << std::endl; } else { std::cout << " bits" << std::endl; } return 0; }