#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
//#define scanf scanf_s

char a[1005][1005];

bool dfs(int x,int y,int k)
{
	REP(i,k)REP(j,k)
	{
		if(a[x+i][y+j] == '*') return false;
	}
	return true;
}

int main()
{
    int n;
    while(cin>>n,n)
	{
		REP(i,n)REP(j,n)
		{
			cin>>a[i][j];
		}
		for(int k = n;k>0;k--)
		{
			for(int i = 0; i+k <= n;i++)for(int j = 0; j+k <= n; j++)
			{
				if(dfs(i,j,k))
				{
					cout << k << endl;
					goto end;
				}
			}
		}
		end:;
	}
}
            