
#include <cstdio>
#include <vector>
using namespace std;

int main(){
  int n;
  while(true){
    scanf("%d", &n);
    if (n == 0){
      break;
    }
    vector<vector<char> > f(n, vector<char>(n, ' '));
    for (int i = 0; i < n; i++){
      for (int j = 0; j < n; j++){
        scanf(" %c", &(f[i][j]));
      }
    }
    vector<vector<char> > checked(n, vector<char>(n, 0));
    int max = 0;
    for (int i = 0; i < n; i++){
      for (int j = 0; j < n; j++){
        if ((f[i][j] == '.') && (checked[i][j] == 0)){
          if (max == 0){
            max = 1;
          }
          checked[i][j] = 1;
          for (int k = 1; k <= n; k++){
            if (((i+k) >= n) || ((j+k) >= n)){
              break;
            }
            bool ok = true;
            for (int l = 0; l <= k; l++){
              if ((f[i+k][j+l] != '.') || (checked[i+k][j+l] != 0)){
                ok = false;
                break;
              }
              if ((f[i+l][j+k] != '.') || (checked[i+l][j+k] != 0)){
                ok = false;
                break;
              }
            }
            if (ok){
              if (k > max){
                max = k;
              }
            }else{
              break;
            }
          }
        }
      }
    }
    printf("%d\n", max+1);
  }
}