#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	int n;
	while(cin>>n,n) 
	{
		int dp[n][n];
		char f[n][n];
		int ans=0;
		memset(dp,-1,sizeof(dp));
		for(int i = 0; i < n; ++i)
		{
			for(int j = 0; j < n; ++j)
			{
				cin>>f[i][j];
				if(i==0||j==0)
				{
					if(f[i][j]=='*') dp[i][j]=0;
					else dp[i][j]=1;
				}
			}
		}
		
		for(int i = 1; i < n; ++i)
		{
			for(int j = 1; j < n; ++j)
			{
				if(f[i][j]=='*') dp[i][j]=0;
				else
				{
					dp[i][j]=min(dp[i][j-1],min(dp[i-1][j-1],dp[i-1][j]))+1;
					ans=max(ans,dp[i][j]);
				}
			}
		}
		cout<<ans<<endl;
	}
  return 0;
}