#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int sum[1111][1111];
int main(void)
{
  while(1){
    int n; 
    cin >> n;
    if(!n) break;
    for(int i = 1; i <=n; i++){
      for(int j = 1; j <=n; j++){
	char c;
	cin >> c;
	sum[j][i] = (c == '*')?1:0;
      }
    }

    for(int i = 1; i <= n; i++){
      for(int j = 1; j <= n; j++){
	sum[j][i] += sum[j-1][i];
      }
    }

    for(int i = 1; i <= n; i++){
      for(int j = 1; j <= n; j++){
	sum[i][j] += sum[i][j-1];
      }
    }    

    int best = 0;
    for(int i = 1; i + best <= n; i++){
      for(int j = 1; j + best <= n; j++){
	for(int k = best ; i + k <= n && j + k <= n && !(sum[i+k][j+k] - sum[i+k][j-1] - sum[i-1][j+k] + sum[i-1][j-1]); k++){
	  best = k + 1;
	}
      }
    }
    cout << best << endl;
  }
}