#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) begin(v), end(v)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

int n;
char mas[1001][1001];
int dp[1001][1001];

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  while(cin >> n, n) {
    rep(i, n) rep(j, n) cin >> mas[i][j];

    int ans = 0;
    rep(i, n) rep(j, n) {
      if(mas[i][j] == '*') dp[i][j] = 0;
      else if(!i || !j) dp[i][j] = 1;
      else dp[i][j] = min({dp[i-1][j-1], dp[i-1][j], dp[i][j-1]}) + 1;
      ans = max(ans, dp[i][j]);
    }

    cout << ans << endl;
  }

  return 0;
}