#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n;
	std::string buf;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif


#if INPUT_FROM_FILE
	while(std::getline(ifs, buf)){
#else
	while(std::getline(std::cin, buf)){
#endif
		n = std::stoi(buf);
		if(n == 0){ break; }
		std::vector<std::string> image;
		std::vector<std::vector<int> > dp(n, std::vector<int>(n, 0));
		int result = 0;


		for(int i = 0; i < n; i++){
#if INPUT_FROM_FILE
			std::getline(ifs, buf);
#else
			std::getline(std::cin, buf);
#endif
			image.push_back(buf);
		}

		for(int y = 0; y < n; y++){
			for(int x = 0; x < n; x++){
				if(image[y][x] == '*'){
					dp[y][x] = 0;
				}
				else if(y > 0 && x > 0){
					dp[y][x] = std::min({ dp[y - 1][x], dp[y][x - 1], dp[y - 1][x - 1] }) + 1;
				}
				else{
					dp[y][x] = 1;
				}
				result = std::max(result, dp[y][x]);
			}
		}
		std::cout << result << std::endl;
	}

#if INPUT_FROM_FILE
	//fclose(fp);
#endif
	return 0;
}
