#include <bits/stdc++.h>

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int N;
char field[1010][1010];
int dp[1010][1010];

int main() {
	while(scanf("%d", &N), N) {
		rep(i, N) scanf("%s", &field[i]);
		memset(dp, 0, sizeof(dp));
		int ans = 0;
		rep(i, N) rep(j, N) {
			if(field[i][j] == '*') dp[i][j] = 0;
			else {
				if(i == 0 || j == 0) dp[i][j] = 1;
				else {
					int mini = min(dp[i - 1][j], dp[i][j - 1]);
					dp[i][j] = min(mini, dp[i - 1][j - 1]) + 1;
				}
			}
			ans = max(ans, dp[i][j]);
		}
		printf("%d\n", ans);
	}
	return 0;
}