#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

string s[1001];
int d[1001][1001];

signed main(){
	int n;
	while (cin >> n && n) {
		rep(i, 0, n) {
			cin >> s[i];
		}
		rep(i, 0, n + 1) {
			rep(j, 0, n + 1) {
				d[i][j] = 0;
			}
		}
		rep(i, 1, n + 1) {
			rep(j, 1, n + 1) {
				if (s[i - 1][j - 1] == '*') d[i][j] = 1;
			}
		}
		rep(i, 1, n + 1) {
			rep(j, 1, n + 1) {
				d[i][j] += d[i - 1][j];
			}
		}
		rep(i, 1, n + 1) {
			rep(j, 1, n + 1) {
				d[i][j] += d[i][j - 1];
				//cout << d[i][j] << " ";
			}
			//cout << endl;
		}
		int MAX = 0;
		rep(i, 1, n + 1) {
			rep(j, 1, n + 1) {
				int ok = 0, ng = min(n + 1 - i, n + 1 - j) + 1;
				rep(k, 0, 11) {
					int m = (ok + ng) / 2;
					if (d[i + m - 1][j + m - 1] + d[i - 1][j - 1] - d[i - 1][j + m - 1] - d[i + m - 1][j - 1] == 0) ok = m;
					else ng = m;
				}
				MAX = max(MAX, ok);
			}
		}
		cout << MAX << endl;
	}
}