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

#define MAX 1010
#define BLOCK '*'

int solve(int n, char G[MAX][MAX]){
  int W[MAX][MAX];
  
  for(int i = 0 ; i < n ; i++){
    W[0][i] = (G[0][i] == BLOCK) ? 0 : 1;
    W[i][0] = (G[i][0] == BLOCK) ? 0 : 1;
  }
  
  int maxWidth = 0;
  
  for(int i = 0 ; i < n ; i++){
    for(int j = 0 ; j < n ; j++){
      if(G[i][j] == BLOCK) W[i][j] = 0;
      else{
	W[i][j] = min(W[i-1][j-1], min(W[i-1][j], W[i][j-1])) + 1;
	maxWidth = max(maxWidth, W[i][j]);
      }
    }
  }
  return maxWidth;
}

int main(){
  int n;
  char G[MAX][MAX];
  
  while(cin >> n, n){
    for(int i = 0 ; i < n ; i++){
      for(int j = 0 ; j < n ; j++){
	cin >> G[i][j];
      }
    } 
    cout << solve(n, G) << endl;
  }
  return 0;
}