#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define F first
#define S second
#define INF 1 << 30

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int n, cum[1024][1024];
char s[1024][1024];

int main(){
  while(scanf("%d", &n) && n){
    memset(cum, 0, sizeof(cum));
    rep(i, n){
      scanf("%s", s[i]);
      rep(j, n){
	if(s[i][j] != '.') continue;
	cum[i+1][j+1] = min(cum[i][j], min(cum[i][j+1], cum[i+1][j])) + 1;
      }
    }

    int res = 0;
    rep(i, n+1) rep(j, n+1)
      res = max(res, cum[i][j]);

    printf("%d\n", res);
  }
  return 0;
}