#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<complex>

#define f first
#define s second
#define mp make_pair

#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()
#define DBL(x) ((x)*(x))
#define EPS 1e-10

using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int memoY[1000*1000];
int memoT[1000*1000];
int memo[1000*1000];
char buff[1000][1010];

int main(){
  int n;
  while(scanf("%d ",&n), n){
    memset(memoY,0,sizeof(int)*n*n);
    memset(memoT,0,sizeof(int)*n*n);
    memset(memo, 0,sizeof(int)*n*n);
    REP(i,n) fgets(buff[i],sizeof(buff[i]),stdin);
    REP(i,n){
      int tmp1 = 1, tmp2 = 1;
      for(int j=0; j<n; j++){
	if(buff[i][j] == '*') tmp1 = 0;
	memoY[i*n+j] = tmp1++;
	if(buff[j][i] == '*') tmp2 = 0;
	memoT[j*n+i] = tmp2++;
      }
    }
    int ans = 0;

    for(int i=0; i<n; i++){
      if(buff[i][0] == '.')
	ans = max(ans, memo[i*n] = 1);
      if(buff[0][i] == '.')
	ans = max(ans, memo[i] = 1);
    }

    for(int i=1; i<n; i++){
      for(int j=1; j<n; j++){
	if(buff[i][j] == '.'){
	  int tmpm = INT_MAX;
	  tmpm = min(tmpm, memoY[i*n+j-1]);
	  tmpm = min(tmpm, memoT[(i-1)*n+j]);
	  tmpm = min(tmpm, memo[(i-1)*n+j-1]);
	  ans = max(ans, memo[i*n+j] = tmpm + 1);
	}
      }
    }

    /*
    REP(i,n) {REP(j,n) printf("%c ",buff[i][j]); puts("");}
    puts("[memoY]");
    REP(i,n) {REP(j,n) printf("%d ",memoY[i][j]); puts("");}
    puts("[memoT]");
    REP(i,n) {REP(j,n) printf("%d ",memoT[i][j]); puts("");}
    puts("[memo]");
    REP(i,n) {REP(j,n) printf("%d ",memo[i][j]); puts("");}
    */

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