#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF (1LL << 25) // 33554432
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int dp[1010][1010];
signed main(void) {
  while (true) {
    int n;
    string s[1010];
    cin >> n;
    if(!n) break;
    REP(i, n) cin >> s[i];

    REP(i, 1010) REP(j, 1010) dp[i][j] = 0;
    int ans = 0;
    REP(i, n) REP(j, n) {
      if (s[i][j] == '*')
        dp[i][j] = 0;
      else if (s[i][j] == '.') {
        if (i > 0 && j > 0)
          dp[i][j] = min({dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]}) + 1;
        else
          dp[i][j] = 1;
      }
      ans = max(ans, dp[i][j]);
    }

    cout << ans << endl;
  }
  return 0;
}