#include<iostream>

using namespace std;

const int MAX = 1001;

int d[MAX][MAX];
char data[MAX][MAX];
int in;

int solve(){
  for(int i = 1; i <= in; i++){
    for(int j = 1; j <= in; j++){
      if(data[i][j] == '.') d[i][j] = min(d[i-1][j], min(d[i][j-1],d[i-1][j-1]))+1;
    }
  }
  int out = -1;
  for(int i = 1; i <= in; i++)
    for(int j = 1; j <= in; j++)
      if(out < d[i][j]) out = d[i][j];
  return out;
}

int main(){
  while(cin >> in && in){
    for(int i = 1; i <= in; i++){
      for(int j = 1; j <= in; j++){
	cin >> data[i][j];
	if(data[i][j] == '*') d[i][j] = 0;
	else d[i][j] = 1;
      }
    }
    cout << solve() << endl;
  }
  return 0;
}