#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define MX 1000005
#define mod 1000000007
#define ll long long
#define pb push_back
#define pll pair<ll,ll>
#define endl "\n"
#define bug(a) cerr<<#a<<" : "<<a<<endl
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define Mul(a,b) (a%mod * b%mod)%mod
#define Add(a,b) (a%mod + b%mod)%mod
ll n, m;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int vis[2005][2005];
char grid[2005][2005];
int cnt = 0;
void dfs(int sx, int sy) {
cnt++;
vis[sx][sy] = 1;
for(int i=0; i<4; i++) {
int x=dx[i]+sx;
int y=dy[i]+sy;
if(x>=0 && x<n && y>=0 && y<m && !vis[x][y] && grid[x][y]=='0')
dfs(x,y);
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll t;
cin>>t;
for(int tc=1; tc<=t; tc++) {
cin>>n>>m;
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
cin>>grid[i][j];
vis[i][j]=0;
}
}
int mx = 0;
for(int i=0; i<n; i++) {
for(int j=0; j<m; j++) {
if(!vis[i][j] && grid[i][j]=='0') {
cnt = 0;
dfs(i, j);
mx = max(mx, cnt);
}
}
}
cout<<"Floor #"<<tc<<": "<<mx<<endl;
}
return 0;
}