#include <iostream>
#include <string>
#include <vector>
using namespace std;

long long int side[1000][1000], ver[1000][1000];

int main() {

  string input, s;

  long long int n;

  while( true ) {

    cin >> n;

    if ( n == 0 ) break;

    vector< string > map;
    s = "**";
    for ( long long int i = 0; i < n; i++ ) {
      s += "*";
    }
    map.push_back( s );
    for ( long long int i = 0; i < n; i++ ) {
      cin >> input;
      input = "*" + input + "*";
      map.push_back( input );
    }
    map.push_back( s );
    for ( long long int i = 1; i <= n; i++ ) {
      long long int cnt_s = 0;
      long long int cnt_v = 0;
      for ( long long int j = 1; j <= n; j++ ) {
	if ( map[i][j] == '*' ) {
	  cnt_s = 0;
	}else {
	  cnt_s++;
	}
	side[i][j] = cnt_s;
	if ( map[j][i] == '*' ) {
	  cnt_v = 0;
	}else {
	  cnt_v++;
	}
	ver[j][i] = cnt_v;
      }
    }
    long long int ans = 0;
    for ( long long int i = 1; i <= n; i++ ) {
      for ( long long int j = 1; j <= n; j++ ) {
	if ( map[j][i] == '.' ) {
	  long long int cnt = 1;
	  while( true ) {
	    if ( side[j+cnt][i+cnt] > cnt && ver[j+cnt][i+cnt] > cnt ) {
	      cnt++;
	      continue;
	    }
	    break;
	  }
	  ans = max( ans, cnt );
	}
      }
    }

    cout << ans << endl;

  }

  return 0;

}