#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>

using namespace std;

int main(){

	int n,max_r;
	char buf[1001];

	int** table = new int*[1001];
	for(int i = 0; i < 1001; i++)table[i] = new int[1001];
	for(int i = 0; i < 1001; i++){
		table[0][i] = 0;
		table[i][0] = 0;
	}

	while(true){
		scanf("%d",&n);
		if(n == 0)break;

		max_r = 0;

		for(int i=0; i < n; i++){
			scanf("%s",buf);
			for(int k= 0;buf[k]!= 0; k++){
				if(buf[k] == '.'){
					table[i+1][k+1] = min(table[i][k],min(table[i][k+1],table[i+1][k]))+1;
					max_r = max(max_r,table[i+1][k+1]);
				}else{
					table[i+1][k+1] = 0;
				}
			}
		}

		printf("%d\n",max_r);
	}

    return 0;
}