#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e9 + 7;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second

int n;
vector<string> table;
vector<vector<ll>> dp;

int main(){
	while (cin >> n&&n){
		table.clear();
		dp.clear();
		table.resize(n);
		dp.resize(n);
		REP(i, n){
			table[i].resize(n);
			dp[i].resize(n);
		}
		REP(i, n){
			string s;
			cin >> s;
			REP(j, n){
				table[i][j] = s[j];
				if (i == 0 || j == 0)dp[i][j] = (s[j] == '.');
			}
		}
		FOR(i, 1, n){
			FOR(j, 1, n){
				if (table[i][j] == '*')continue;
				dp[i][j] = min(dp[i][j - 1], min(dp[i - 1][j - 1], dp[i - 1][j])) + 1;
			}
		}
		ll ans = 0;
		REP(i, n){
			REP(j, n){
				ans = max(ans, dp[i][j]);
			}
		}
		cout << ans << endl;
	}
}