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

int n;
int sq[1000][1000];

bool safe(int x, int y){
    return (x >= 0 && y >= 0 && x < n && y < n);
}

int minOf4(int x, int y){
    int b = 0;
    if (sq[x+1][y+1] && sq[x][y+1] && sq[x+1][y]){
	b = min(sq[x+1][y+1], min(sq[x][y+1], sq[x+1][y]));
    }
    return b;
}

int main(){
    while (1){
	cin >> n;
	if (!n) break;

	char c;
	for (int i = 0; i < n; i++){
	    for (int j = 0; j < n; j++){
		cin >> c;
		if (c == '.') sq[i][j] = 1;
		else sq[i][j] = 0;
	    }
	}

	for (int i = n-1; i >= 0; i--){
	    for (int j = n-1; j >= 0; j--){
		if (sq[i][j] != 0)
		    sq[i][j] += minOf4(i, j);
	    }
	}

	int m = 0;
	for (int i = 0; i < n; i++){
	    for (int j = 0; j < n; j++){
		if (m < sq[i][j]) m = sq[i][j];
	    }
	}

	cout << m << endl;
    }
}