#include <iostream>
#include <vector>
#include <string>
using namespace std;
typedef vector<int> vi;

int main()
{
	int n;
	while(cin >> n, n){
		vector<string> field(n + 1);
		vector<vi> table(n + 1, vi(n + 1));
		int x, y, i, lim;
		field[0] = "*";
		for(int x=0;x<n;x++)
			field[0] += "*";
		for(y = 1; y <= n; y++){
			string line;
			cin >> line;
			field[y] = "*" + line;
		}
		
		for(y = 0; y <= n; y++)
			for(x = 0; x <= n; x++){
				if(y == 0 && x == 0)
					table[y][x] = field[y][x] == '*';
				else if(y == 0)
					table[y][x] = table[y][x-1] + (field[y][x] == '*');
				else if(x == 0)
					table[y][x] = table[y-1][x] + (field[y][x] == '*');
				else
					table[y][x] = table[y][x-1] + table[y-1][x] - table[y-1][x-1] + (field[y][x] == '*');
			}
		
		int res = 0;
		for(y = 0; y <= n; y++){
			for(x = 0; x <= n; x++){
				lim = min(n-y, n-x) + 1;
				for(int i=1;i<lim;i++){
					if(table[y + i][x + i] - table[y][x + i] - table[y + i][x] + table[y][x] == 0)
						res=max(res, i);
					else break;
				}
			}
		}
		cout << res << endl;
	}
}