#include <iostream>
#include <algorithm>
using namespace std;


int n;
char sq[1000][1000];
int dp[1000][1000];


int solve(){
	int ans = 0;

	for(int i = 0;i < n;i++){
		dp[0][i] = (sq[0][i] == '*' ? 0 : 1);
		dp[i][0] = (sq[i][0] == '*' ? 0 : 1);
	}
	for(int y = 1;y < n;y++){
		for(int x = 1;x < n;x++){
			if(sq[y][x] == '*') dp[y][x] = 0;
			else {
				dp[y][x] = min({ dp[y-1][x], dp[y][x-1], dp[y-1][x-1] }) + 1;
				ans = max(ans, dp[y][x]);
			}
		}
	}

	return ans;
}


int main(){
	while(cin >> n, n != 0){
		for(int i = 0;i < n;i++){
			for(int j = 0;j < n;j++){
				cin >> sq[i][j];
			}
		}

		cout << solve() << endl;
	}

	return 0;
}