#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define dbg(a,b,c,d) cerr<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
#define kill(a) {cout<<a<<endl;continue;}
#define KILL(a) {cout<<a<<endl;return 0;}
#define debug cerr<<"Error Found"<<endl;
#define mem(a,b) memset(a,b,sizeof(a))
#define lcm(a, b) (a/__gcd(a,b))*b
#define w(t) cin>>t;while(t--)
#define pi 2 * acos(0.0)
#define endl "\n"
int t, cs = 0;
const int mxn = 2e3 + 3, mod = 1e9 + 7;
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, 1, -1};
int n, m;
string str[mxn];
bool vis[mxn][mxn];
bool ok(int i, int j)
{
return (i >= 0 and j >= 0 and i < n and j < m and !vis[i][j] and str[i][j] == '0');
}
int bfs(int r, int c)
{
queue<pair<int,int>>q;
q.push(make_pair(r, c));
int space = 0;
while(!q.empty())
{
int x = q.front().first, y = q.front().second;
q.pop();
if(vis[x][y])continue;
vis[x][y] = true, space++;
for(int i = 0; i < 4; i++)
{
int X = x + dx[i], Y = y + dy[i];
if(ok(X, Y))q.push(make_pair(X, Y));
}
}
return space;
}
void refresh(int n, int m)
{
for(int i = 0; i < n; i++)for(int j = 0; j < m; j++)vis[i][j] = false;
}
int32_t main()
{
fast
w(t)
{
cin >> n >> m;
refresh(n, m);
for(int i = 0; i < n; i++)cin >> str[i];
int ans = 0;
for(int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++)
{
if(str[i][j] == '1' or vis[i][j])continue;
ans = max(ans, bfs(i, j));
}
}
cout << "Floor #" << ++cs <<": " << ans << endl;
}
}