#include<iostream>
#include<stack>
#include<map>
using namespace std;

#define max(a,b) (a>b?a:b)
#define min(a,b) (a>b?b:a)
#define rep(i,n) for(int i=0; i<n; ++i)
#define repl(i,n,s) for(int i=s; i<=n; ++i)

#define N 1002

typedef pair<int, int> P;

int main() {
  int n, dp[N][N], ans;
  char c;
  stack<P> st;
  while(1) {
    cin >> n;
    if(!n) break;
    ans = 0;
    rep(i, n) {
      rep(j, n) {
        cin >> c;
        if(c == '*') {
          dp[i][j] = 0;
        }else {
          dp[i][j] = i ? dp[i-1][j]+1 : 1;
        }
        int back = j;
        while(!st.empty() && dp[i][j] < st.top().second) {
          if(st.top().first + st.top().second <= j) {
            ans = max(ans, st.top().second);
          }
          back = st.top().first;
          st.pop();
        }
        if(st.empty() || st.top().second < dp[i][j]) {
          st.push(P(back, dp[i][j]));
        }
      }
      while(!st.empty()) {
        if(st.top().first + st.top().second <= n) {
          ans = max(ans, st.top().second);
        }
        st.pop();
      }
    }
    cout << ans << endl;
  }
  return 0;
}