#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  while(cin >>n,n){
    int f[1000][1000] = {0};
    string s;
    for(int i=0; i<n; i++){
      cin >>s;
      for(int j=0; j<n; j++){
	if(s[j] == '.') f[j][i] = 0;
	if(s[j] == '*') f[j][i] = 1;
      }
    }
    int dp[1000][1000]={0};
    int m = 0;
    for(int i=0; i<n; i++){
      for(int j=0; j<n; j++){
	if(f[j][i] == 0){
	  if(i == 0) dp[j][i] = 1;
	  else if(j == 0) dp[j][i] = 1;
	  else dp[j][i] = min(dp[j-1][i],min(dp[j-1][i-1],dp[j][i-1]))+1;
	  if(m<dp[j][i]) m = dp[j][i];
	}
      }
    }
    cout <<m<<endl;
  }
  return 0;
}