//on the name of Allah:)
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define pi 2 * acos(0.0)
#define mod 1000000007
#define Mul(a,b) (a%mod * b%mod)%mod
#define Add(a,b) (a%mod + b%mod)%mod
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define gcd(x, y) (__gcd(x, y))
#define lcm(x, y) ((x/gcd(x, y))*y)
#define faster cin.tie(NULL), cout.tie(NULL);
#define TC int t ; cin>>t ; while (t--)
const int N = 2e3 + 7;
using namespace std;
int n,m,cnt=1;
queue<pair<int,int>>q;
char l[N][N];
int vis[N][N];
int dis[N][N];
int dRow[] = { -1, 0, 1, 0 };
int dCol[] = { 0, 1, 0, -1 };
bool isValid(int row, int col)
{
if (row < 1 || col < 1 || row > n || col > m)
return false;
if (vis[row][col])
return false;
if (l[row][col]!='0')
return false;
return true;
}
void bfs(int x, int y)
{
q.push({x,y});
vis[x][y]++;
while(!q.empty())
{
int u = q.front().first;
int v = q.front().second;
q.pop();
for(int i=0; i<4; i++)
{
int adju = u+dRow[i];
int adjv = v+dCol[i];
if(isValid(adju,adjv))
{
cnt++;
q.push({adju,adjv});
vis[adju][adjv]++;
}
}
}
}
int32_t main()
{
ios::sync_with_stdio(false);
int t;
cin >> t;
int f = 1;
while(t--)
{
int ans = -1;
cin >> n >> m;
for(int i=1; i<=n; i++)
{
for(int j=1; j<=m; j++)
{
cin >> l[i][j];
}
}
for(int i=1; i<=n; i++)
{
for(int j=1; j<=m; j++)
{
if(vis[i][j]==0 && l[i][j]=='0')
{
bfs(i,j);
}
ans = max(ans,cnt);
cnt = 1;
}
}
cout << "Floor #" << f++ << ": " << ans << endl;
for(int i=1; i<=n; i++)
{
for(int j=1; j<=m; j++)
{
vis[i][j] = 0;
}
}
}
}