#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;

  while (cin >> n, n) {
    vector<vector<int>> v(n);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        char c;
        cin >> c;
        v[i].push_back(c == '.');
      }
    }

    int ans = 0;
    for (int i = 1; i < n; ++i) {
      for (int j = 1; j < n; ++j) {
        if (v[i][j]) v[i][j] = min({v[i - 1][j - 1], v[i - 1][j], v[i][j - 1]}) + 1;
        ans = max(ans, v[i][j]);
      }
    }

    cout << ans << endl;
  }
}