#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
  int n;
  while (cin >> n, n) {
    vector<vector<char>> vec(n + 1, vector<char>(n + 1));
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        cin >> vec[i][j];

    vector<vector<int>> vec2(n + 1, vector<int>(n + 1, 0));
    //for (int i = 0; i <= n; ++i)
    //  vec2[i][0] = vec2[0][i] = 0;

    int vmax = 0;
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        int vmin = min({vec2[i-1][j], vec2[i-1][j-1], vec2[i][j-1]});
        vec2[i][j] = (vec[i][j] == '*') ? 0 : vmin + 1;
        if (vmax < vec2[i][j])
          vmax = vec2[i][j];
      }
    }
    cout << vmax << endl;
  }
}
