#include "bits/stdc++.h"
using namespace std;

int n;
int dp[1000][1000];
char G[1000][1000];

int solve() {
  int ans = 0;

  memset(dp, 0, sizeof(dp));

  for(int i = 0; i < n; i++) {
    for(int j = 0; j < n; j++) {
      if(G[i][j] == '*') dp[i][j] = 0;
      else {
        if(i > 0 && j > 0) {

//          dp[i][j] = min({dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]}) + 1;
          int a = min(dp[i - 1][j], dp[i][j - 1]);
          dp[i][j] = min(a, dp[i - 1][j - 1]) + 1;
        }
        else dp[i][j] = 1;
        ans = max(ans, dp[i][j]);
      }
    }
  }

  return ans;
}

int main() {
  ios_base::sync_with_stdio(false);

  while(cin >> n && n) {
    for(int i = 0; i < n; i++) {
      for(int j = 0; j < n; j++) {
        cin >> G[i][j];
      }
    }
    cout << solve() << endl;
  }
  return 0;
}