#include <iostream>
#include <cstdio>
using namespace std;

int main(){
	int field[1000][1000];
	int n,dp[1000][1000];
	while(cin >> n,n){
		getchar();
		for(int i = 0;i < n;i++){
			for(int j = 0;j < n;j++){
				char c = getchar();
				if(c == '.') field[i][j] = 1;
				else field[i][j] = 0;
				dp[i][j] = 0;
			}
			getchar();
		}
		for(int i = 0;i < n;i++){
			dp[i][0] = field[i][0];
			dp[0][i] = field[0][i];
		}
		int ma = 0;
		for(int i = 1;i < n;i++){
			for(int j = 1;j < n;j++){
				if(!field[i][j]) dp[i][j] = 0;
				else dp[i][j] = min(min(dp[i - 1][j],dp[i][j - 1]),dp[i - 1][j - 1]) + 1;
				ma = max(ma,dp[i][j]);
			}
		}
		cout << ma << endl;
	}
	return 0;
}