#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int w[1005][1005];
int main()
{
	string s[1005];
	int n;
	while(cin >> n && n)
	{
		memset(w,0,sizeof(w));
		rep(i,n)
		{
			cin >> s[i];
		}

		rep(i,n)
		{
			rep(j,n)
			{
				if(s[i][j] == '*') w[i][j] = 0;
				else w[i][j] = 1;
			}
		}

		int ans = 0;
		REP(i,1,n)
		{
			REP(j,1,n)
			{
				if(s[i][j] == '*')
				{
					w[i][j] = 0;
				}
				else
				{
					w[i][j] = min(w[i-1][j-1],min(w[i-1][j],w[i][j-1])) + 1;
					ans = max(ans,w[i][j]);
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}