#include <iostream>
#include <cstdio>

using namespace std;

int DP[2000][2000];

string str[2000];

int min(int a, int b, int c){
	if(a <= b && a <= c){
		return a;
	}else if(b <= c){
		return b;
	}else{
		return c;
	}
}

int main(){
	
	int n, ans;
	
	cin >> n;
	while(n != 0){
		for(int i = 0; i < n; i++){
			cin >> str[i];
		}
		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				DP[i][j] = 0;
			}
		}
		
		for(int i = 0; i < n; i++){
			if(str[0][i] == '.'){
				DP[0][i] = 1;
			}else{
				DP[0][i] = 0;
			}
			if(str[i][0] == '.'){
				DP[i][0] = 1;
			}else{
				DP[i][0] = 0;
			}
		}
		
		for(int i = 1; i < n; i++){
			for(int j = 1; j < n; j++){
				if(str[i][j] == '*'){
					DP[i][j] = 0;
				}else{
					DP[i][j] = min(DP[i - 1][j], DP[i][j - 1], DP[i - 1][j - 1]) + 1;
				}
			}
		}
		
		ans = 0;
		
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				if(ans < DP[i][j]){
					ans = DP[i][j];
				}
			}
		}
		
		printf("%d\n", ans);
		
		cin >> n;
	}
	
	return 0;
}