#include <bits/stdc++.h>
 
using namespace std;
 
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplece_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
 
//int dxy[5] = {0, 1, 0, -1, 0};
// assign
 
int table[1002][1002];

int func(int stx, int sty, int nx, int ny);

signed main()
{
    Int(n);
    while (n) {
    vector< string > board(n);
    rep(i, n) {
        cin >> board[i];
    }

    memset(table, 0, sizeof(table));

    rep(i, n) {
        rep(j, n) {
            if (board[i][j] == '*') {
                table[i+1][j+1]++;
            }
        }
    }

    rep(i, n) {
        Rep(j, n) {
            table[i+1][j+1] += table[i+1][j];
        }
    }

    rep(j, n) {
        Rep(i, n) {
            table[i+1][j+1] += table[i][j+1];
        }
    }

    int ans = 0;

    Rep(i, n) {
        int stx = i-1, sty = 0, nx = i, ny = 1;
        int num = func(stx, sty, nx, ny);
        for (int add = 0; add + i <= n; add++) {
            int tmp = func(stx, sty, nx + add, ny + add);
            while (tmp != 0 && stx < nx + add && sty < ny + add) {
                stx++; sty++;
                tmp = func(stx, sty, nx + add, ny + add);
            }
            ans = max(ans, nx + add - stx);
        }
    }

    rep(i, n+1) {
        for (int j = i; j <= n; j++) {
            int tmp = table[i][j];
            table[i][j] = table[j][i];
            table[j][i] = tmp;
        }
    }

    Rep(i, n) {
        int stx = i-1, sty = 0, nx = i, ny = 1;
        int num = func(stx, sty, nx, ny);
        for (int add = 0; add + i <= n; add++) {
            int tmp = func(stx, sty, nx + add, ny + add);
            while (tmp != 0 && stx < nx + add && sty < ny + add) {
                stx++; sty++;
                tmp = func(stx, sty, nx + add, ny + add);
            }
            ans = max(ans, nx + add - stx);
        }
    }

    cout << ans << endl;

    cin >> n;
    }

    return 0;
}

int func(int stx, int sty, int nx, int ny)
{
    return table[nx][ny]+table[stx][sty]-table[stx][ny]-table[nx][sty];
}