#include<cstdio>
#include<cstring>
#include<algorithm>
int a[1000][1000];
char s[1000][1001];
using namespace std;
int main(void)
{
	int n,i,j,k,low,high,mid,x,cnt,flg,f2;
	while(1)	{
		scanf("%d",&n);
		if(n==0)	break;
		for(i=0;i<n;i++)	scanf("%s",s[i]);
		for(i=0;i<n;i++)	{
			cnt=0;
			for(j=n-1;j>=0;j--)	{
				if(s[i][j]=='*')	{
					cnt=0;
					a[i][j]=cnt;
				}
				else {
					cnt++;
					a[i][j]=cnt;
				}
			}
		}
		low=0;	high=n;
		while(low<=high)	{
			mid=(low+high)/2;
			f2=0;
			for(i=0;i<n;i++)	{
				for(j=0;j<n;j++)	{
					if(a[i][j]>=mid)	{
						flg=1;
						for(k=i+1;k<i+mid;k++)	{
							if(k>=n || a[k][j]<mid)	{
								flg=0;
								break;
							}
						}
						if(flg==1)	{
							f2=1;
							j=n;
							i=n;
						}
					}
				}
			}
			if(f2==1)	{
				low=mid+1;
			}
			else {
				high=mid-1;
				if(high==0)	break;
			}
		}
		printf("%d\n",high);
	}
	return 0;
}
