#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int n;
vector<pair<int,int> > objList;
char field[1000][1000];

bool check(int y,int x,int size){
	for(int i = 0; i < objList.size(); i++){
		if(x+size<n
			&&y+size<n
			&&objList[i].first>=y&&objList[i].first<=y+size
			&&objList[i].second>=x&&objList[i].second<=x+size){
				return false;
		}
	}
	return true;
}

int main(){

	while(cin>>n&&n!=0){
		objList.clear();
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				cin>>field[i][j];
				// áQ¨XgÉÇÁ
				if(field[i][j]=='*'){
					objList.push_back(make_pair(i,j));
				}
			}
		}
		int maxSize=0;

		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				for(int k = n-1; k >= 0; k--){
					if(i+k>=n||j+k>=n)
						break;
					if(check(i,j,k)){
						if(maxSize<=k+1){
							maxSize=max(maxSize,k+1);
							break;
						}
					}
				}
			}
		}
		cout<<maxSize<<endl;
	}

	return 0;
}