#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

typedef pair<int, int> P;

int main() {
  int n, ans, t;
  int dp[2][1000];
  char cbuf[1001];

  while (1) {
    scanf("%d\n", &n);
    if (!n) break;
    ans = 0;
    memset(&dp[0][0], 0, sizeof(int)*n);
    memset(&dp[1][0], 0, sizeof(int)*n);
    for (int i=0; i<n; i++) {
      fgets(cbuf, sizeof(cbuf), stdin);
      dp[i&1][0] = (cbuf[0]=='.') ? 1 : 0;
      for (int j=1; j<n; j++) {
        if (cbuf[j] == '.') {
          t = min(dp[i&1][j-1], min(dp[(i+1)&1][j-1], dp[(i+1)&1][j]))+1;
          dp[i&1][j] = t;
          if (ans < t) ans = t;
        } else {
          dp[i&1][j] = 0;
        }
      }
    }
    printf("%d\n", ans);
  }
  
  return 0;
}