
import std.stdio, std.conv, std.algorithm;
import std.range, std.array;

// n, m を基点にして右側にどれだけ四角形を作れるか
int counter(ref char[][] field, int n, int m, int edge) {
  int size = 1;
  while(true) {
    if ((n + size) > edge || (m + size) > edge) break;
    for(int i = 0; i <= size; i++) {
      if (field[n + size][m + i] == '*' || field[n + i][m + size] == '*')
        goto end;
    }
    size += 1;
  }
 end:
  field[n][m] = '*';
  // for(int i = 0; i <= size; i++) {
  //   field[n][m] = '*';
  // }
  return size;
}

void main() {
  int edge;
  while(readf("%d\n", &edge), edge != 0) {
    char[][] field;
    field ~= repeat('*').take(edge + 2).array;
    for(int n = 0; n < edge; n++) {
      string s;
      readf("%s\n", &s);
      field ~= ['*'] ~ s.to!(char[]) ~ ['*'];
    }
    field ~= repeat('*').take(edge + 2).array;
    int square = 0;
    foreach(i; 1..(edge + 1)) {
      foreach(j; 1..(edge + 1)) {
        if (field[i][j] != '*') {
          int size = counter(field, i, j, edge);
          if (size > square) square = size;
        }
      }
    }
    writeln(square);
  }
}