#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int n;
  while(cin>>n,n) {
    char c[n][n];
    REP(i,n)
      REP(j,n)
      cin >> c[j][i];
    int dp[n][n];
    memset(dp,0,sizeof(dp));
    int ans = 0;
    REP(y,n) {
      REP(x,n) {
        if (c[x][y] == '.') {
          if (x>0&&y>0&&dp[x-1][y-1]>0) {
            int i=0;
            for(;i<dp[x-1][y-1];i++)
              if (c[x][y-i-1] == '*' || c[x-i-1][y] == '*')
                break;
            if (i==dp[x-1][y-1])
              dp[x][y] = i+1;
          } else
            dp[x][y] = 1;
        }
        ans = max(ans,dp[x][y]);
      }
    }
    cout << ans << endl;
  }
}