#include <stdio.h>
#include <algorithm>
using namespace std;

int issquare(int,int,int);
int field[1000][1000];

int main(){
	int i,j,n,ans;
	char map;
	while(1){
		ans = 0;
		scanf("%d",&n);
		if(!n) break;
		getchar();
		for(i = 0;i < n;i++){
			for(j = 0;j < n;j++) {
				map = getchar();
				if(map == '.') field[i][j] = 0;
				else field[i][j] = 1;
			}
			getchar();
		}
		for(i = 0;i < n;i++){
			for(j = 0;j < n;j++) {
				if(field[i][j] == 0) ans = max(ans,issquare(i,j,n));
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

int issquare(int x,int y,int n){
	int i,j,k;
	for(i = 2;;i++){
		for(j = 0;j < i;j++){
			for(k = 0;k < i;k++){
				if(x + j >= n || y + k >= n || field[x + j][y + k] != 0) {
					return i - 1;
				}
			}
		}
	}
}