#include<iostream>
#include<cstdio>
using namespace std;

char stage[1000][1000];
int main(){
	int n;
	while (cin >> n, n){
		for (int i = 0; i < n; i++){
			cin >> stage[i];
		}

		int ny, nx, ans = 0;
		int situ_y[2] = { 0, 1 }, situ_x[2] = { 1, 0 };
		for (int y = 0; y < n; y++){
			for (int x = 0; x < n; x++){
				if (stage[y][x] != 0 && stage[y][x] != '*'){
					for (int i = 0;; i++){
						bool flag = false;
						for (int j = 0; j < 2; j++){
							for (int k = i; k >= 0; k--){
								ny = y + situ_y[j] * i + situ_x[j] * k;
								nx = x + situ_x[j] * i + situ_y[j] * k;
								if (ny < 0 || n <= ny || nx < 0 || n <= nx
									|| stage[ny][nx] == '*'){
									flag = true;
									if (i > ans){
										ans = i;
									}
								}
								if (flag){
									if (k == i) k--;
									for (; k >= 0; k--){
										for (int l = 0; l < k /*&& k != i*/; l++){
											ny = y + situ_x[j] * k + situ_y[j] * l;
											nx = x + situ_y[j] * k + situ_x[j] * l;
											stage[ny][nx] = 0;
										}
									}
									break;
								}
							}
						}
						if (flag) break;
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}