#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>

using namespace std;

#define INF 999999
char stage[1010][1010];
int dp[1010][1010];
int main(){
	int n;
	while(scanf("%d",&n),n){
		memset(stage,0,sizeof(stage));
		memset(dp,0,sizeof(stage));
		int ans = 0;
		for(int i = 0; i < n; i++){
			scanf("%s",stage[i]);
			for(int j = 0; j < n; j++){
                dp[i][j] = (stage[i][j]=='*') ? 0 : ans = 1;
			}
		}
		for(int i = 1; i < n; i++){
			for(int j = 1; j < n ;j++){
				if(stage[i][j] == '*')continue;
				dp[i][j] = min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
				ans = max(dp[i][j],ans);
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}