#include using namespace std; inline int read(){ int x=0,f=1;char cc=getchar(); while(cc<'0' || cc>'9') {if(cc=='-') f=-1;cc=getchar();} while(cc>='0' && cc<='9') {x=x*10+cc-'0';cc=getchar();} return x*f; } int tt,ttt,a[1010],b[1024],ans,x,n,m,k; char cc; int main(){ ttt=read(); for(tt=1;tt<=ttt;tt++){ n=read();m=read();k=read(); for(int i=1;i<=n;i++){ a[i]=0; for(int j=1;j<=m;j++){ cc=getchar(); if(cc=='A') a[i]=a[i]*2+1; else a[i]=a[i]*2; } cc=getchar(); } ans=0; for(int i=0;i<1<=2*k) ans++; } printf("Case #%d: %d\n",tt,ans); } }