#include <iostream>
#include <string>
using namespace std;

int main(){
  int i,j,n,a[1000][1000],max[1000][1000],ans;
  char b;
  while(1){
    cin >> n;
    if(n == 0) break;

    for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	cin >> b;
	max[i][j] = 0;
	if(b == '.') a[i][j] = 1;
	else if(b == '*') a[i][j] = 0;
      }
    }

    for(i=0;i<n;i++){
      if(a[0][i] == 1) max[0][i] = 1;
      if(a[i][0] == 1) max[i][0] = 1;
    }

    ans = 0;
    for(i=1;i<n;i++){
      for(j=1;j<n;j++){
	if(a[i][j] == 1){
	  max[i][j] = max[i-1][j-1] + 1;
	  if(max[i][j] > max[i-1][j] + 1) max[i][j] = max[i-1][j] + 1;
	  if(max[i][j] > max[i][j-1] + 1) max[i][j] = max[i][j-1] + 1;
	  if(ans < max[i][j]) ans = max[i][j];
	}
      }
    }

    cout << ans << endl; 

  }
  return 0;
}