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

const int MAXN = 1001;
int N;
char G[MAXN][MAXN];
int dp[MAXN][MAXN];

int main() {
  while(cin >> N && N) {
    for(int i = 0; i < N; ++i) {
      for(int j = 0; j < N; ++j) {
        cin >> G[i][j];
      }
    }
    int ans = 0;
    fill(dp[0], dp[MAXN], 0);
    for(int i = 0; i < N; ++i) {
      for(int j = 0; j < N; ++j) {
        if(i == 0 || j == 0) dp[i][j] = (G[i][j] == '.');
        else {
          if(G[i][j] == '.') {
            dp[i][j] = min(min(dp[i-1][j], dp[i][j-1]), dp[i-1][j-1]) + 1;
          } else {
            dp[i][j] = 0;
          }
        }
        ans = max(ans, dp[i][j]);
      }
    }
    cout << ans << endl;
  }
  return 0;
}