#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <vector>
#include <algorithm>

#define int64 long long int
using namespace std;

int square_search(string *, int);
int size(string *, int, int, int);

int main()
{
	int i, n;
	string *map;

	while(1){
		cin >> n;
		if(n == 0) break;
	
		map = new string[n];
	
		for(i=0; i<n; i++)
			cin >> map[i];

		cout << square_search(map, n) << endl;

		delete[] map;
	}

	return 0;
}

int square_search(string *map, int n)
{
	int s, max=0;
	for(int i=0; i<n; i++){
		for(int j=0; j<n; j++){
			if(map[i][j] == '.'){
				s = size(map, i, j, n);
				if(max < s) max = s;
			}
		}
	}
	return max;
}

int size(string *map, int i, int j, int n)
{
	int k = 1;
	while(i+k < n && j+k < n){
		for(int l=0; l<=k; l++){
			if(map[i+l][j+k] == '*') return k;
			if(map[i+k][j+l] == '*') return k;
		}
		k++;
	}
	return k;
}