#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<cstdio>
#include<cstring>
#include<vector>
using namespace std;
#define mp(a,b) make_pair(a,b)
#define fr first
#define sc second
typedef pair<string,int> Pi;
int main(){
  int n;
  while(cin >> n , n){
    char mas[1000][1000];
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
        cin >> mas[i][j];
      }
    }
    int cnt[1000][1000] = {{}} , ans = 0;
    for(int i=0;i<n;i++){
      if(mas[i][0] == '.') cnt[i][0] = 1;
      if(mas[0][i] == '.') cnt[0][i] = 1;
    }
    for(int i=1;i<n;i++){
      for(int j=1;j<n;j++){
        if(mas[i][j] == '*') cnt[i][j] = 0;
        else{
          cnt[i][j] = min(cnt[i-1][j-1],min(cnt[i-1][j],cnt[i][j-1])) + 1;
          ans = max(ans,cnt[i][j]);
        }
      }
    }
    cout << ans << endl;
  }
}