#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int board[1000][1000];

int min(int a,int b,int c){
	int m =0;
	if(a > b){
		m = b;
	}else{
		m = a;
	}
	if(m > c){
		m = c;
	}
	return m;
}

int main(){
	int n;
	char str;
	while(cin >> n){
		
		if(n == 0){
			return 0;
		}
		//テ、ツスツソテァツ板ィテ」ツδ愿」ツδシテ」ツδ嘉」ツつ?テ」ツ?ァテ・ツ按敕ヲツ慊淌・ツ個?
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				board[i][j] = 1;
			}
		}
		//*テ」ツ?ョテゥツδィテ・ツ按?」ツつ?1テ」ツ?ィテ」ツ?凖」ツつ?
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				cin >> str;
				if(str == '*'){
					board[i][j] = -1;
				}
			}
		}
		/*
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				cout << board[i][j] << " ";
			}
			cout << endl;
		}*/
		
		
		for(int i=1;i<n;i++){
			for(int j=1;j<n;j++){
				if(board[i][j] != -1){
					if((board[i-1][j] != -1) &&(board[i][j-1] != -1) &&(board[i-1][j-1] != -1)){
						board[i][j] = min(board[i-1][j],board[i][j-1],board[i-1][j-1]) + 1;
					}
				}
			}
		}
		
		int max = 0;
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				if(board[i][j] >= max){
					max = board[i][j];
				}
			}
		}
	
		cout << max << endl;
	}

		return 0;
}
	