#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>

using namespace std;

int main(void){
  int n;

  while(cin >> n){
	int f[2][n];
	string str;
	int cur=0, prv=1;
	int ret=0;

	if(!n) break;
	for(int i=0;i<n;i++){
	  cin >> str;
	  for(int j=0;j<n;j++){
		if(i == 0 || j == 0){ // first line
		  if(str[j] == '.'){
			f[cur][j] = 1;
		  }else{
			f[cur][j] = 0;
		  }
		}else{
		  if(str[j] == '.'){
			f[cur][j] = min(f[cur][j-1], min(f[prv][j], f[prv][j-1])) + 1;
		  }else{
			f[cur][j] = 0;
		  }
		}
		//cout << f[cur][j];
		ret = max(ret, f[cur][j]);
	  }
	  //cout << endl;
	  cur = 1 - cur;
	  prv = 1 - prv;
	}
	cout << ret << endl;
  }
}