#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

char g[1000][1000];
int dp[1000][1000];
int main() {
	int n;
	while (scanf("%d", &n), n) {
		rep(i, n)scanf("%s", g[i]);
		rep(i, n)rep(j, n) {
			if (g[i][j] == '.')dp[i][j] = 1;
		}
		int Max = 0;
		for (int i = 1; i < n; i++)for (int j = 1; j < n; j++) {
			if (g[i][j] == '*')dp[i][j] = 0;
			else {
				dp[i][j] = min(dp[i - 1][j - 1], min(dp[i][j - 1], dp[i - 1][j])) + 1;
				Max = max(Max, dp[i][j]);
			}
		}
		printf("%d\n", Max);
	}
}