#include <iostream>
using namespace std;

#define N 1000
#define MIN(X,Y) ((X)<(Y)?(X):(Y))
#define MAX(X,Y) ((X)>(Y)?(X):(Y))

int main(void){
  int dp[N+1][N+1];
  char c, fld[N][N];
  int n, ans;
  
  while (cin >> n){
    if (n==0) break;
    // read & init
    for (int i=0; i<n; i++){
      for (int j=0; j<n; j++){
        cin >> c;
        fld[j][i] = c;
        dp[j+1][i+1] = 0;
      }
    }
    for (int i=0; i<=n; i++) dp[i][0] = dp[0][i] = 0;
    // dp
    ans = 0;
    for (int i=1; i<=n; i++){
      for (int j=1; j<=n; j++){
        if (fld[j-1][i-1]=='.'){
          dp[j][i] = MIN(dp[j-1][i-1], MIN(dp[j-1][i], dp[j][i-1])) + 1;
          ans = MAX(ans, dp[j][i]);
        } else {
          dp[j][i] = 0;
        }
//        cout << dp[j][i] << " ";
      }
//      cout << endl;
    }
    cout << ans << endl;
  }
  return 0;
}
