

#include<cstdio>
#include<map>
#include<iostream>

using namespace std;


const int N = 1111;

string board[N];
int dp[N][N];


int main(){
	
	while(1){
		int n;
		cin>>n;
		
		if(n==0)break;
		
		
		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++){
			cin>>board[i];
		}
		
		int ans = 0;
		
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				if(board[i-1][j-1]=='*')dp[i][j] = 0;
				if(board[i-1][j-1]=='.')dp[i][j] = min(min(dp[i-1][j], dp[i][j-1]), dp[i-1][j-1]) + 1;
				ans = max(ans, dp[i][j]);
			}
		}
		
		printf("%d\n",ans);
	}
}