#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int dp[1000][1000];
int N;

inline int get(int r, int c) {
    if(r < 0 || r >= N || c < 0 || c >= N) return 0;
    return dp[r][c];
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    while(cin >> N) {
        if(N == 0) break;
        for(int i = 0; i < N; ++i) {
            string line;
            cin >> line;
            for(int c = 0; c < N; ++c) {
                dp[i][c] = get(i-1, c) + get(i, c-1) - get(i-1, c-1);
                if(line[c] == '*') dp[i][c]++;
            }
        }
        int ans = 0;
        for(int r = 0; r < N; ++r) {
            for(int c = 0; c < N; ++c) {
                int left = 0, right = N+1;
                while(left < right-1) {
                    int size = (left+right)>>1;
                    const int er = r+size-1;
                    const int ec = c+size-1;
                    if(er >= N || ec >= N) {
                        right = size;
                    } else {
                        int marks = get(er, ec) - get(er, c-1) - get(r-1, ec) + get(r-1, c-1);
                        if(marks == 0) {
                            left = size;
                        } else {
                            right = size;
                        }
                    }
                }
                ans = max(ans, left);
            }
        }
        cout << ans << endl;
    }
    return 0;
}