#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <stdlib.h>
#define rep(i, n) for(int i=0;i<n;i++)
#define FOR(i, j, n) for(int i=j;i<n;i++)
#define LEVEL 0
// #define DEBUG

int N;
char** data;
int** dp;

void debug(const char* str) {
#ifdef DEBUG
    std::cout << str << " " << std::endl;
#endif
}

void debug(int i) {
#ifdef DEBUG
    std::cout << i << " " <<  std::endl;
#endif
}

void debug_arr(int** data, int n) {
#ifdef DEBUG
    rep(i, n) {
        rep(j, n) std::cout << data[i][j] << " ";
        std::cout << std::endl;
    }
#endif
}
void debug_arr(char** data, int n) {
#ifdef DEBUG
    rep(i, n) {
        rep(j, n) std::cout << data[i][j] << " ";
        std::cout << std::endl;
    }
#endif
}

int search() {
    FOR(i, 1, N) {
        FOR(j, 1, N) {
            int k = i;
            int l = j;
            int up = 0, left = 0;
            int previous = dp[i - 1][j - 1] + 1;

            debug("----------------");
            debug_arr(dp, N);
            debug("----------------");
            debug(k);
            debug(l);
            debug("----------------");
            while(k >= 0 && data[k][j] == '.') {
                ++up;
                --k;
            }
            while(l >= 0 && data[i][l] == '.') {
                ++left;
                --l;
            }
            debug(up);
            debug(left);
            debug("==================");

            dp[i][j] = std::min({up, left, previous});
        }
    }

    return 1;
}

int main() {
    while(1) {
        std::cin >> N;
        if (N == 0) return 0;
        data = (char**)malloc(sizeof(char*) * N);
        rep(i, N) data[i] = (char*)malloc(sizeof(char) * N);
        dp = (int**)malloc(sizeof(int*) * N);
        rep(i, N) dp[i] = (int*)malloc(sizeof(int) * N);
        rep(i, N) rep(j, N) std::cin >> data[i][j];

        debug_arr(data, N);
        debug_arr(dp, N);

        rep(i, N) {
            dp[i][0] = data[i][0] == '.' ? 1 : 0;
            dp[0][i] = data[0][i] == '.' ? 1 : 0;
        }

        search();
        int max = 0;
        rep(i, N) rep(j, N) max = max < dp[i][j] ? dp[i][j] : max;
        std::cout << max << std::endl;
        free(data);
        free(dp);
    }

    return 0;
}

/**
  int N = 0;
  char** data;
  int result = 0;
  int search(int x, int y);

  int next_search(int x, int y) {
  int next_x, next_y = 0;
  if (x == N - 1) {
  if (y == N - 1) return 0;

  return search(0, y + 1);
  }

  return search(x + 1, y);
  }

  int search(int x, int y) {
  if (x + result >= N) return next_search(x, y);
  if (y + result >= N) return 0;
  if (data[x][y] == '*') return next_search(x, y);

  result = result == 0 ? 1 : result;

  for (int i = 1; i <= N - x; i++) {

  if (y + i > N)
  return next_search(x, y);

  FOR(k, x, x + i) {
  FOR(l, y,  y + i) {
  if(data[k][l] == '.') {
  continue;
  }
  return next_search(x, y);
  }
  }
  result = result < i ? i : result;
  }

  return next_search(x, y);
  }


  int main() {
  while(1) {
  cin >> N;
  if (N == 0) return 0;
  data = (char**)malloc(sizeof(char*) * N);
  rep(i, N) data[i] = (char*)malloc(sizeof(char) * N);
  rep(i, N) rep(j, N) cin >> data[i][j];
  search(0, 0);
  cout << result << endl;
  result = 0;
  free(data);
  }

  return 0;
  }


 **/