#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
using namespace std;
int dp[1001][1001];
int main(){
    int n;
    while(cin>>n,n){
        fill(dp[0],dp[0]+1001*1001,0);
        for(int i=0;i<n;i++){
            string str;
            cin>>str;
            for(int j=0;j<n;j++){
                dp[i+1][j+1]=dp[i+1][j]+dp[i][j+1]-dp[i][j];
                if(str[j]=='*')dp[i+1][j+1]++;
            }
        }
        int Max=0;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                for(int k=0;i+k<=n&&j+k<=n;k++){
                    int sum=dp[i+k][j+k]-dp[i-1][j+k]-dp[i+k][j-1]+dp[i-1][j-1];
                    if(sum!=0)break;
                    Max=max(Max,k+1);
                }
            }
        }
        cout<<Max<<endl;
        
    }
}