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