#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
int n,T=1;
while(scanf("%d",&n),n>0)
{
printf("Case %d: %d\n",T++,(int)ceil(log10(n)/log10(2))); //换底公式
}
return 0;
}
#include<cmath>
using namespace std;
int main()
{
int n,T=1;
while(scanf("%d",&n),n>0)
{
printf("Case %d: %d\n",T++,(int)ceil(log10(n)/log10(2))); //换底公式
}
return 0;
}