#include <iostream>
#include <algorithm>
#include <cstring>
int main(){
	int n;
	while(std::cin >> n, n){
		std::string s[n];
		for(int i=0;i<n;i++){
			std::cin >> s[i];
		}

		int maxside[n][n], max = 0;//(i,j)ðEºÆµ½Æ«Â­êéÅåÌ³û`ÌPÓ
		memset(maxside, 0, sizeof(maxside));
		for(int i=0;i<n;i++){
			maxside[0][i] = s[0][i]=='*'?0:1;
			maxside[i][0] = s[i][0]=='*'?0:1;
		}
		for(int i=1;i<n;i++){
			for(int j=1;j<n;j++){
				if(s[i][j] == '*')maxside[i][j] = 0;
				else{maxside[i][j] = std::min(maxside[i-1][j-1],
																 std::min(maxside[i-1][j],
																					maxside[i][j-1]))+1;}
				max = std::max(max, maxside[i][j]);
			}
		}
		 
		std::cout << max << std::endl;
	}
}