#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb push_back
#define mp make_pair
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef pair<int, pii> pip;
 
 
 
const int INF = 1000000;
const double EPS = 1e-8;
const int mod = 1e9 + 7;

vii v;

bool check(int x1, int y1, int x2, int y2){
	x1--; y1--;
	return (v[y2][x2]-v[y2][x1]-v[y1][x2]+v[y1][x1])==0;
}

int  main(){
	int n;
	vector<string> s;
	while(cin>>n && n){
		s = vector<string>(n);
		rep(i, n) cin>>s[i];
		v = vii(n+2, vi(n+2, 0));
		rep(i, n){
			rep(j, n){
				v[i+1][j+1] = v[i+1][j]+(s[i][j] == '*' ? 1:0);
			}
		}
		rep(i, n){
			rep(j, n){
				v[i+1][j+1]+=v[i][j+1];
			}
		}
		int ans = 0;
		for(int i = 1; i <= n; i++){
			for(int j = 1; j <= n; j++){
				int l = 1, h = n-max(i,j), m;
				//while(l+1<h){
				rep(k, 100){
					m = (l+h)/2;
					if(check(i, j, i+m, j+m)){
						l = m ;//+ 1;
					}else{
						h = m ;//- 1;
					}
				}
				//while(!check(i, j, i + l, j + l)) l--;
				if(check(i, j, i + h, j + h)) ans = max(ans, h + 1);
				if(check(i, j, i + l, j + l)) ans = max(ans, l + 1);
			}
		}
		cout<<ans<<endl;

		// rep(i, n + 1){
		// 	rep(j, n + 1){
		// 		printf("%d ", v[i][j]);
		// 	}
		// 	printf("\n");
		// }
		//ep(i, n) cout<<s[i]<<endl;
	}
}