#include "bits/stdc++.h"
using namespace std;
int n;

int main(void) {
	while (cin >> n) {
		if (!n)
			break;
		char data[n][n];
		string s[n];
		for (int i = 0; i < n; ++i) {cin>>data[i];}
		int sum=0;

		for (int i = 0; i < n; ++i) {for (int j = 0; j < n; ++j) {int a = 0;
			bool flag=false;
			//for (int z = 0; z <= a; ++z) {
			while(1){
				for (int k = 0; k <= a; ++k) {
						if (data[i + a][j+k] != '.'||data[i+k][j+a] != '.'){flag=true;break;}
					}
					if(flag)break;
					a++;
					sum=max(sum,a);
				}
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}