#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>


using namespace std;

char buf[1024];
int vertical[1024];
int canSize1[1024];
int canSize2[1024];

int main()
{
	while (true)
	{
		int n;
		cin.getline(buf, sizeof(buf));
		sscanf(buf, "%d", &n);
		if (n == 0)
			break;

		int ans = 0;
		memset(vertical, 0, sizeof(vertical));
		memset(canSize1, 0, sizeof(canSize1));
		memset(canSize2, 0, sizeof(canSize2));
		int* size[] = { canSize1, canSize2 };
		for (int i = 0; i < n; ++i)
		{
			cin.getline(buf, sizeof(buf));
			int horizontal = 0;
			int* canSize = size[i&1];
			int* prevSize = size[(i+1)&1];
			for (int j = 1; j <= n; ++j)
			{
				if (buf[j-1] == '.')
				{
					++horizontal;
					++vertical[j];
					canSize[j] = min(prevSize[j-1]+1, min(horizontal, vertical[j]));
					if (canSize[j] > ans)
						ans = canSize[j];
				}
				else
					canSize[j] = vertical[j] = horizontal = 0;
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}