# include <stdio.h>
int main() {
int input, ans ;
for ( scanf( "%d", &input ) ; input != 0 ; scanf( "%d", &input ) ) {
for ( ans = 0 ; input > 0 && input % 2 == 1 ; ans++ )
input /= 2 ;
printf( "%d\n", ans ) ;
} // for
} // main()