#include <cstdio>
#include <algorithm>
using namespace std;

int n;
int ans;
int dp[10000][10000];

int main() {
  while (1) {
    scanf("%d", &n);
    if (n == 0) return 0;

    ans = 0;
    for (int i=0; i<n; i++) {
      for (int j=0; j<n; j++) {
        char c;
        scanf("%c ", &c);
        if (c == '.') {
          dp[i][j] = 1;
          if (i > 0 && j > 0) {
            int t = min(dp[i-1][j], dp[i][j-1]);
            dp[i][j] = max(dp[i][j], min(t, dp[i-1][j-1])+1);
          }
        } else dp[i][j] = 0;
  
        ans = max(ans, dp[i][j]);
      }
    }
  
    printf("%d\n", ans);
  }
}