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

int dp[1000][1000];

void printmap(int size){
  for(int i = 0; i < size; i++){
    for(int j = 0; j < size; j++){
      cout << dp[i][j] << " ";
    }
    cout << endl;
  }
}

int main(void){
  int size, max;
  char c;
  while(cin >> size, size != 0){
    max = 0;
    for(int i = 0; i < size; i++) for(int j = 0; j < size; j++) dp[i][j] = 1;
    
    for(int i = 0; i < size; i++) for(int j = 0; j < size; j++){
      cin >> c;
      if(c == '*') dp[i][j] = 0;
    }
    for(int i = 1; i < size; i++) for(int j = 1; j < size; j++){
      if(dp[i][j] == 0) continue;
      dp[i][j] = min(dp[i-1][j], min(dp[i-1][j-1], dp[i][j-1])) + 1;
      if(max < dp[i][j]) max = dp[i][j];
    }
    cout << max << endl;
  }
  return 0;
}