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

int main() {
    int n;
    while(cin >> n, n) {
        vector<string> v(n);
        for(int i=0; i<n; ++i) {
            cin >> v[i];
        }
        vector<vector<int>> dp(n, vector<int>(n));
        int res = 0;
        for(int i=0; i<n; ++i) {
            for(int j=0; j<n; ++j) {
                if(v[i][j] == '*') {
                    dp[i][j] = 0;
                } else if(i == 0 || j == 0) {
                    dp[i][j] = 1;
                } else {
                    dp[i][j] = min(dp[i-1][j], min(dp[i-1][j-1], dp[i][j-1])) + 1;
                }
                res = max(res, dp[i][j]);
            }
        }
        cout << res << endl;
    }
}
