#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
char f[1001][1001];
int n;
int ans;
bool C(int x,int y,int p)
{
	for(int i=x;i<x+p;i++)
	{
		for(int j=y;j<y+p;j++)
		{
			if(i>=n||j>=n)return false;
			if(f[i][j]=='*')return false;
		}
	}
	return true;
}
int check(int x,int y)
{
	if(!C(x,y,ans+1))return 0;
	int l=ans+1,r=n+1;
	while(r-l>1)
	{
		int mid=(l+r)/2;
		if(C(x,y,mid))l=mid;
		else r=mid;
	}
	return l;
}
int main()
{
	while(1)
	{
		ans=0;
		cin >> n;
		if(n==0)break;
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				cin >> f[i][j];
			}
		}
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(f[i][j]=='.')
				{
					ans=max(ans,check(i,j));
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}