#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)

using namespace std;

int main() {
  while(1){
    int n;
    cin>>n;
    if(!n)break;
    vector<string> mp(n);
    REP(i,n) cin>>mp[i];
    vector<vector<int>> s(n,vector<int>(n));
    REP(i,n)REP(j,n)
      s[i][j] = (mp[i][j] == '.');
    FOR(i,1,n){
      FOR(j,1,n){
        if (s[i][j] == 0) continue;
        int minr = min(s[i-1][j], min(s[i-1][j-1], s[i][j-1]));
        s[i][j] = max(minr + 1, s[i][j]);
      }
    }
    int maxr = 0;
    REP(i,n)
      maxr=max(maxr, *max_element(begin(s[i]), end(s[i])));
    cout << maxr << endl;
  }
  return 0;
}