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

int c[1000][1000];

int main() {
    int n;
    while (cin >> n, n) {
        vector<string> ms(n);
        for (int i = 0; i < n; i++) {
            cin >> ms[i];
        }
        for (int i = 0; i < n; i++) {
            c[0][i] = (ms[0][i] == '*') ? 0 : 1;
            c[i][0] = (ms[i][0] == '*') ? 0 : 1;
        }
        int ans = 0;
        for (int y = 1; y < n; y++) {
            for (int x = 1; x < n; x++) {
                if (ms[y][x] == '*') {
                    c[y][x] = 0;
                    continue;
                }
                c[y][x] = min(c[y][x-1], min(c[y-1][x-1], c[y-1][x])) + 1;
                ans = max(ans, c[y][x]);
            }
        }
        cout << ans << endl;
    }
}