#include<cstdio>
#include<vector>
#include<string.h>
using namespace std;

int board[1000][1000];
int res[1000][1000];

int main() {

  int n;
  char c;
  while(1) {
    scanf("%d", &n);
    if(!n) break;

    memset(board, 0, sizeof(board));
    memset(res, 0, sizeof(res));
    scanf("%c", &c);
    for(int i=0; i<n; ++i) {
      for(int j=0; j<n; ++j) {
	scanf("%c", &c);
	if(c == '.') {
	  board[i][j] = 1;
	  res[i][j] = 1;
	} else if(c == '*') board[i][j] = 2;
      }
      scanf("%c", &c);
    }

    int maxi = 0;
    for(int i=0; i<n; ++i) {
      for(int j=0; j<n; ++j) {
	if(board[i][j] == 1) {
	  if(i == 0 || j == 0 || board[i-1][j] == 2 || board[i][j-1] == 2 || board[i-1][j-1] == 2) {
	    res[i][j] = 1;
	  } else {
	    res[i][j] = min( res[i-1][j], min( res[i-1][j-1], res[i][j-1] ) ) + 1;
	  }
	  maxi = max( maxi, res[i][j] );
	}
      }
    }

    /*
    for(int i=0; i<n; ++i) {
      for(int j=0; j<n; ++j) {
	printf("%d", res[j][i]);
      }
      printf("\n");
    }
    */
    printf("%d\n", maxi);
  }
}