#include <iostream>
#include <string>
#include <vector>
using namespace std;

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

int main(){
	vector <string> grid;
	static int dp[1000][1000];

	while(1){
		int n;
		cin >> n;
		if(n==0) break;

		for(int i=0;i<n;i++){
			string buf;
			cin >> buf;
			grid.push_back(buf);
		}
		for(int i=0;i<n;i++){
			if(grid[0][i]=='*') dp[0][i] = 0;
			else dp[0][i] = 1;
		}
		for(int i=1;i<n;i++){
			if(grid[i][0]=='*') dp[i][0] = 0;
			else dp[i][0] = 1;
		}

		int maxWidth = 0;
		for(int i=1;i<n;i++){
			for(int j=1;j<n;j++){
				if(grid[i][j]=='*') dp[i][j] = 0;
				else{
					dp[i][j] = min3(dp[i-1][j], dp[i-1][j-1], dp[i][j-1]) + 1;
					if(dp[i][j]>maxWidth) maxWidth = dp[i][j];
				}
			}
		}
		cout << maxWidth << endl;
		grid.clear();
	}
}