#include <cstdio>
#include <cstring>
//#include <cstdlib>
//#include <cmath>
//#include <string>
#include <algorithm>
//#include <vector>
#define INF (2000000000)
using namespace std;

//typedef vector<int> VI;
//typedef vector<int>::iterator VII;
//typedef vector<double> VD;
//typedef vector<double>::iterator VDI;

char map[1024][1024];
int dp[1024][1024];

int main()
{
	int n;
	while (scanf("%d", &n), n){
		memset(dp, 0, sizeof(dp));
		for (int i = 0; i < 1024; i++){
			for (int j = 0; j < 1024; j++){
				map[i][j] = '\0';
			}
		}
		
		for (int i = 1; i <= n; i++){
			for (int j = 1; j <= n; j++){
				scanf(" %c", &map[i][j]);
			}
		}
		
		for (int i = 1; i <= n; i++){
			for (int j = 1; j <= n; j++){
				if (map[i][j] == '.'){
					dp[i][j] = min(dp[i - 1][j - 1], min(dp[i - 1][j], dp[i][j - 1])) + 1;
				}
	//			printf("%d", dp[i][j]);
			}
	//		printf("\n");
		}
		
		int maxi = 0;
		for (int i = 1; i <= n; i++){
			for (int j = 1; j <= n; j++){
				maxi = max(maxi, dp[i][j]);
			}
		}
		
		printf("%d\n", maxi);
	}
	
	return 0;
}