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

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

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;
    long long int x, y;
    for ( long long int i = 0; i < 2 * n - 1; i++ ) {
      if ( i < n ) {
	x = 1;
	y = n - i;
      }else {
	x = i - ( n - 2 );
	y = 1;
      }
      long long int cnt = 0;
      while( true ) {
	if ( side[y][x] > cnt && ver[y][x] > cnt ) {
	  cnt++;
	}else {
	  ans = max( ans, cnt );
	  cnt = min( side[y][x], ver[y][x] );
	}
	x++;
	y++;
	if ( x > n || y > n ) break;
      }
      ans = max( ans, cnt );
    }

    cout << ans << endl;

  }

  return 0;

}