#include<iostream>
#include<string>
#include<algorithm>
#include<cstring>
using namespace std;

int main(){

  int n;
  string s[10000];
  int w[1001][1001];

  while(cin >> n, n){
    memset(w,0,sizeof(0));
    int ans = 0;

    for(int i=0;i<n;i++) cin >> s[i];

    for(int i=0;i<n;i++){
      if(s[0][i] == '.') w[0][i] = 1;
      if(s[i][0] == '.') w[i][0] = 1;
    }


    for(int i=1;i<n;i++){
      for(int j=1;j<n;j++){

	if(s[i][j] == '*') w[i][j] = 0;

	else{
	  w[i][j] = min(w[i-1][j-1],min(w[i][j-1],w[i-1][j])) + 1;
	  ans = max(ans,w[i][j]);
	}

      }
    }

    cout << ans << endl;
 
  }
}