#include <bits/stdc++.h>
#define range(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) range(i,0,n)
using namespace std;

int n;
string board[1010];
int dp[1010][1010];

int main(void){
	while(cin >> n,n){
		rep(i,n) cin >> board[i];
		rep(j,n) dp[0][j]=(board[0][j]=='.');
		range(i,1,n)rep(j,n){
			if(j==0){
				dp[i][j]=(board[i][j]=='.');
			}else{
				int next=min({dp[i-1][j-1],dp[i-1][j],dp[i][j-1]});
				if(board[i][j]=='.')
					dp[i][j]=next+1;
				else
					dp[i][j]=0;
			}
		}
		int ans=0;
		rep(i,n)rep(j,n) ans=max(ans,dp[i][j]);
		cout << ans << endl;
	}
	return 0;
}