#include <iostream>
#include <algorithm>
#include <vector>
//#include <stack>
//#include <queue>
//#include <map>
#include <cmath>
//#include <string>
//#include <sstream>
#include <iomanip>
//#include <complex>
#include <stdio.h>
//小数制度 	cout << fixed << setprecision(5) << tmp << endl;
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
int main(){
  	int n;
  	while(cin >> n,n){
		vector<string> data;
		REP(i,n){
			string tmp;
			cin >> tmp;
			data.pb(tmp);
		}
	
		int tmap[1001][1001]={0};
		int tmp = 0;
		//create map
		FOR(i,0,n){
			if(data[0][i]=='*') tmp++;
			tmap[1][i+1] = tmp;
		}
		FOR(i,2,n+1){
			tmp = 0;
			FOR(j,0,n){
				if(data[i-1][j]=='*') tmp++;
				tmap[i][j+1] = tmap[i-1][j+1] + tmp;
			}
		}
		/*FOR(i,1,n+1){
			FOR(j,1,n+1){
				cout << tmap[i][j];
			}
			cout << endl;
		}*/
		int ans = 1;
		bool update = false;
		FOR(i,1,n+1){
			FOR(j,1,n+1){
				FOR(k,ans,n){
					if((i+k-1<=n)&&(j+k-1<=n)){
						int kazu = tmap[i+k-1][j+k-1]+tmap[i-1][j-1]-tmap[i-1][j+k-1]-tmap[i+k-1][j-1];
						if(kazu==0){
							ans = max(ans,k);
							update = true;
						}
					}
				}
			}
		}
		if(update == false ) cout << "0" << endl;
		else cout << ans << endl;
	}

  return 0;
}