#include <stdio.h>

int main() {
    int n, count, maxcount = 0;
    while (scanf("%d", &n) != EOF) {
        // printf("the input number is %d\n", n);
        while(n > 0) {
            count = 0;
            while(n & 1){
                count++;
                // printf("encounter one, now count is %d\n", count);
                n >>= 1;
            }
            if(count > maxcount) maxcount = count;
            // printf("maxcount now is %d\n", maxcount);
            n >>= 1;
        }
        printf("%d\n", maxcount);
    }
    return 0;
}