#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	int n;
	char field[1001][1001];
	int under[1001][1001];
	int right[1001][1001];
	int squareSize[1001][1001];

	while(cin>>n&&n!=0){
		int maxSize=0;

		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				cin>>field[i][j];
			}
		}

		for(int i = 0; i < 1001; i++){
			for(int j = 0; j < 1001; j++){
				under[i][j]=-1;
				right[i][j]=-1;
				squareSize[i][j]=0;
			}
			//fill(under[i],under[i]+1001,-1);
			//fill(right[i],right[i]+1001,-1);
			//fill(squareSize[i],squareSize[i]+1001,0);
		}

		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				// º
				if(field[i][j]=='*'){
					
				}
				else if(i-1<0||field[i-1][j]=='*'){
					int cnt=0;
					for(int k = i+1;k<n; k++){
						if(field[k][j]=='*')
							break;
						cnt++;
					}
					under[i][j]=cnt;
				}
				else if(i-1>=0&&field[i][j]=='.'){
					under[i][j]=under[i-1][j]-1;
				}
				// E
				if(field[i][j]=='*'){
					
				}
				else if(j-1<0||field[i][j-1]=='*'){
					int cnt=0;
					for(int k = j+1;k<n; k++){
						if(field[i][k]=='*')
							break;
						cnt++;
					}
					right[i][j]=cnt;
				}
				else if(j-1>=0&&field[i][j]=='.'){
					right[i][j]=right[i][j-1]-1;
				}
			}
		}
		// ì¬Å«ésquareÌTCYðmè
		for(int i = n-1; i >= 0; i--){
			for(int j = n-1; j >= 0; j--){
				if(field[i][j]=='.'){
					if(i+1<n&&j+1<n&&field[i+1][j+1]=='.'){
						// TuXNFAÌTCY
						int ss=squareSize[i+1][j+1];
						// TuXNFAÉdËé`ÅXNFAªìêéê
						if(under[i][j]>=ss&&right[i][j]>=ss){
							squareSize[i][j]=ss+1;
							maxSize=max(maxSize,squareSize[i][j]);
						}
						// ìêÈ¢êAunderÆrightÌTCY©çAìêéTCYðmè
						else{
							int m=min(under[i][j],right[i][j]);
							squareSize[i][j]=m+1;
							maxSize=max(maxSize,squareSize[i][j]);
						}
					}
					// EºªAX^Ü½ÍtB[hOÌê
					else{
						squareSize[i][j]=1;
						maxSize=max(maxSize,squareSize[i][j]);
					}
				}
				// ©gÌêªAX^Ìê
				else{
					squareSize[i][j]=0;
				}
			}
		}
		cout<<maxSize<<endl;
	}

	return 0;
}