#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){

    int n;
    while(cin>>n){
        if(n==0)break;
        char tile[1000];
        int dp[2][1000];
        int most = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                cin>>tile[j];
                if(tile[j]=='.')dp[1][j] = 1;
                else dp[1][j] = 0;
                if(dp[1][j]!=0){
                    int least = n;
                    int x=dp[1][j-1],y=dp[0][ j ],z=dp[0][j-1];
                    x<y ? (x<z ? least = x : least = z) : (y<z ? least = y : least = z);
                    dp[1][j] = least + 1;
                }
                if(dp[1][j] > most)most = dp[1][j];
                //printf("%2d ",dp[1][j]);

            }
            for(int j=0;j<n;j++)dp[0][j] = dp[1][j];
            //cout<<endl;
        }
        cout<<most<<endl;
    }



    return 0;
}