#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <queue>
#include <cmath>
#include <stack>
#include <numeric>
#include <ctime>
#include <algorithm>
#include <set>
#include <stdio.h>
#include <map>

using namespace std;
typedef long long int lint;

int min(int a, int b)
{
	if (a < b) return a;
	else return b;
}

int solve(int n)
{
	int ret = 0;

	int** a = new int*[n + 1];
	for (int i = 0; i <= n; i++){
		a[i] = new int[n + 1];
	}
	for (int i = 0; i <= n; i++){
		for (int j = 0; j <= n; j++){
			a[i][j] = 0;
		}
	}

	string buf;

	for (int i = 0; i < n; i++){
		cin >> buf;
		for (int j = 0; j < n; j++){
			if (buf[j] != '*'){
				int ni = i + 1;
				int nj = j + 1;
				a[ni][nj] = min(a[ni - 1][nj - 1], min(a[ni][nj - 1], a[ni - 1][nj])) + 1;
				if (ret < a[ni][nj]) ret = a[ni][nj];
			}
		}
	}



	for (int i = 0; i <= n; i++){
		delete[] a[i];
	}
	delete[] a;

	return ret;
}

int main()
{
	int n;
	while (1){
		cin >> n;
		if (n == 0) break;
		cout << solve(n) << endl;
	}
	return 0;
}