#include <stdio.h>
#include <string.h>

int main()
{
    int n;
    while (scanf("%d", &n) != EOF)
    {
        int count = 0;
        int max = 0;
        while (n != 0)
        {
            while (n % 2 == 1)
            {
                count++;
                n /= 2;
            }
            if (count > max)
                max = count;

            count = 0;
            n /= 2;
        }
        printf("%d\n", max);
    }

    return 0;
}