#include<stdio.h>
#include<algorithm>
int main()
{
	static char a[1000][1002];
	static int n,i,j,w[1000][1000],v;
	while(scanf("%d",&n),n)
	{
		for(i=0;i<n;++i)
		{
			scanf("%s",a[i]);
			w[i][0] = (a[i][0]=='.');
		}
		for(j=0;j<n;++j)
			w[0][j] = (a[0][j]=='.');
		v=0;
		for(i=1;i<n;++i)
			for(j=1;j<n;++j)
			{
				if(a[i][j]=='*') w[i][j]=0;
				else
				{
					w[i][j] = std::min(w[i-1][j], std::min(w[i-1][j-1],w[i][j-1]))+1;
					v = std::max(w[i][j],v);
				}
			}
		printf("%d\n",v);
	}
	return 0;
}