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

#define rep(i,a) for(int i = 0 ; i < a ; i ++)
#define loop(i,a,b) for(int i = a ; i < b ; i ++)

using namespace std;

int main(void){
  int n;
  char c;
  while(cin>>n,n){
    vector<vector<int> > dp(n,vector<int>(n));
    string s;
    rep(i,n){
      cin>>s;
      rep(j,n){
        if(s[j]=='*')dp[i][j]=0;
        else if(i == 0 || j == 0)dp[i][j]=0;
        else dp[i][j] = 1e9;
      }
    }

    loop(i,1,n){
      loop(j,1,n){
        if(dp[i][j]==0)continue;
        dp[i][j] = min(min(dp[i][j-1],dp[i-1][j]),dp[i-1][j-1])+1;
      }
    }

    int ret = 0;
    rep(i,n){
      rep(j,n){
        ret = max(ret,dp[i][j]);
      }
    }
    cout<<ret<<endl;
  }
}