#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
void solve(int cs) {
int n, m;
cin >> n >> m;
vector<vector<char>> g(n, vector<char>(m));
for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) cin >> g[i][j];
vector<vector<int>> vis(n, vector<int>(m, false));
auto isval = [&](int i, int j) -> bool {
return i >= 0 && j >= 0 && i < n && j < m && g[i][j] == '0' && !vis[i][j];
};
auto f = [&](int i, int j) -> int {
queue<array<int, 2>> Q;
Q.push({i, j});
int cnt = 0;
vis[i][j] = true;
while (Q.size()) {
auto &[x, y] = Q.front();
Q.pop();
cnt += 1;
for (auto &[dx, dy] : {pair(1, 0), pair(0, 1), pair(-1, 0), pair(0, -1)}) {
int nx = dx + x, ny = dy + y;
if (isval(nx, ny)) {
Q.push({nx, ny});
vis[nx][ny] = true;
}
}
}
return cnt;
};
int res = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (g[i][j] == '0') {
if (!vis[i][j]) {
res = max(res, f(i, j));
}
}
}
}
cout << "Floor #" << cs << ": "<< res << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
cin >> tc;
for (int cs = 1; cs <= tc; cs++) {
solve(cs);
}
return 0;
}