#include <cassert>
#include <algorithm>
#include <cstdio>

static const size_t n_max = 1000;
static struct {
  int x, y, r;
} dp[2][n_max+1];

int main() {
  size_t n;
  for (;;) {
    scanf("%zu\n", &n);
    if (!n)
      return 0;
    int r = 0;
    for (size_t i = 0; i < 2; i++)
      for (size_t j = 0; j <= n; j++) {
        dp[i][j].x = 0;
        dp[i][j].y = 0;
        dp[i][j].r = 0;
      }
    for (size_t i = 0; i < n; i++) {
      for (size_t j = 1; j <= n; j++) {
        switch (getchar()) {
          case '.':
            dp[(i+1)%2][j].x = 1 + dp[(i+1)%2][j-1].x;
            dp[(i+1)%2][j].y = 1 + dp[i%2][j].y;
            dp[(i+1)%2][j].r = 1 + std::min(dp[(i+1)%2][j-1].x, std::min(dp[i%2][j].y, dp[i%2][j-1].r));
            break;
          case '*':
            dp[(i+1)%2][j].x = 0;
            dp[(i+1)%2][j].y = 0;
            dp[(i+1)%2][j].r = 0;
            break;
        }
        r = std::max(r, dp[(i+1)%2][j].r);
      }
      assert(getchar() == '\n');
    }
    printf("%d\n", r);
  }
}