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

int main(void){
	int n;

	while(cin>>n && n){
		char f[n][n];
		int count[n][n];
		int ans = 0;

		for(int i=0;i<n;i++){
			cin>>f[i];
			for(int j=0;j<n;j++){
				count[i][j] = f[i][j]=='.' ? (ans=1) : 0;
			}
		}

		for(int i=1;i<n;i++){
			for(int j=1;j<n;j++){
				if(f[i][j] == '*') continue;
				int nc = min(count[i-1][j-1],min(count[i-1][j],count[i][j-1]))+1;
				count[i][j] = nc;
				ans = max(nc,ans);
			}
		}

		cout<<ans<<endl;
	}

	return 0;
}