#include <bits/stdc++.h>

using namespace std;

static inline int in(){ int x; scanf("%d", &x); return x; }

int main()
{
  int field[1024][1024];
  int n;
  while (n = in()){
    for (int i = 0; i < n; i++){
      string s;
      cin >> s;
      for (int j = 0; j < n; j++){
        field[i][j] = s[j] == '.';
      }
    }
    int maxi = 0;
    for (int i = 1; i < n; i++){
      for (int j = 1; j < n; j++){
        if (field[i][j]){
          field[i][j] = min(field[i - 1][j - 1], min(field[i - 1][j], field[i][j - 1])) + 1;
          maxi = max(maxi, field[i][j]);
        }
      }
    }
    printf("%d\n", maxi);
  }

  return 0;
}