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

int maxSquare(string map[]) {
  int n = map[0].length();
  int size[n][n];

  int max = 0;
  for(int i = 0; i < n; i++) {
    if(map[i][0] == '*') size[i][0] = 0;
    else                 size[i][0] = 1;
    if(size[i][0] > max) max = size[i][0];

    if(map[0][i] == '*') size[0][i] = 0;
    else                 size[0][i] = 1;
    if(size[0][i] > max) max = size[0][i];
  }

  for(int i = 1; i < n; i++) {
    for(int j = 1; j < n; j++) {
      if(map[i][j] == '*') {
	size[i][j] = 0;
      } else {
	if(size[i-1][j-1] <= size[i-1][j] && size[i-1][j-1] <= size[i][j-1])
	  size[i][j] = size[i-1][j-1] + 1;
	if(size[i-1][j] <= size[i][j-1] && size[i-1][j] <= size[i-1][j-1])
	  size[i][j] = size[i-1][j] + 1;
	if(size[i][j-1] <= size[i-1][j-1] && size[i][j-1] <= size[i-1][j])
	  size[i][j] = size[i][j-1] + 1;

	if(size[i][j] > max) max = size[i][j];
      }
    }
  }
  return max;
}

int main() {
  int n;

  while(1) {
    cin >> n;
    if(n == 0) break;
    string map[n];
    getchar();
    for(int i = 0; i < n; i++) {
      getline(cin, map[i]);
    }

    cout << maxSquare(map) << endl;
  }
  return 0;
}