#include <bits/stdc++.h>
 
using namespace std;
 
#define ull unsigned long long
#define ll long long
#define int long long
#define ld long double
 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
 
#define MX LLONG_MAX
#define MN LLONG_MIN

const int N=1e5+5;
const ll mod=1e9+7;
 
ll powermodm(ll x,ll n,ll M){ll result=1;while(n>0){if(n % 2 ==1)result=(result * x)%M;x=(x*x)%M;n=n/2;}return result;}
ll power(ll _a,ll _b){ll _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
ll gcd(ll a,ll b){if(a==0)return b;return gcd(b%a,a);}          
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

int32_t main()                  
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,m;
    cin>>n>>m;
    string s[n];
    for(ll i=0;i<n;i++)
    {
        cin>>s[i];
        //cout<<s[i]<<" "<<endl;
    }
    vector<ll> a[n+1],b[m+1];
    for(ll i=0;i<n;i++)
    {
        a[i+1].pb(0);
        a[i+1].pb(m+1);
    }
    for(ll i=0;i<m;i++)
    {
        b[i+1].pb(0);
        b[i+1].pb(n+1);
    }
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<m;j++)
        {
            if(s[i][j]=='#')
            {
                //cout<<i+1<<" "<<j+1<<endl;
                a[i+1].pb(j+1);
                b[j+1].pb(i+1);
            }
        }
    }
    for(ll i=1;i<=n;i++)
        sort(a[i].begin(),a[i].end());
    for(ll j=1;j<=m;j++)
        sort(b[j].begin(),b[j].end());
    // for(ll i=0;i<n;i++)
    // {
    //     for(ll j=0;j<a[i+1].size();j++)
    //         cout<<a[i+1][j]<<" ";
    //     cout<<endl;
    // }
    // for(ll i=0;i<m;i++)
    // {
    //     for(ll j=0;j<b[i+1].size();j++)
    //         cout<<b[i+1][j]<<" ";
    //     cout<<endl;
    // }
    ll ans = 0;
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<m;j++)
        {
            if(s[i][j]=='.')
            {
                //cout<<i+1<<" "<<j+1<<endl;
                ll x = i+1;
                ll y = j+1;
                ll l = 0,r = a[x].size()-1;
                ll left = 0;
                while(l<=r)
                {
                    ll mid = (l+r)>>1;
                    if(a[x][mid]<y)
                    {
                        l = mid+1;
                        left = max(left,a[x][mid]);
                    }
                    else
                    {
                        r = mid-1;
                    }
                }
                l = 0;
                r = a[x].size()-1;
                ll right = m+1;
                while(l<=r)
                {
                    ll mid = (l+r)>>1;
                    if(a[x][mid]>y)
                    {
                        r = mid-1;
                        right = min(right,a[x][mid]);
                    }
                    else
                    {
                        l = mid+1;
                    }
                }
                l = 0;
                r = b[y].size()-1;
                ll up = 0;
                while(l<=r)
                {
                    ll mid = (l+r)>>1;
                    if(b[y][mid]<x)
                    {
                        l = mid+1;
                        up = max(up,b[y][mid]);
                    }
                    else
                    {
                        r = mid-1;
                    }
                }
                l = 0;
                r = b[y].size()-1;
                ll down = n+1;
                while(l<=r)
                {
                    ll mid = (l+r)>>1;
                    if(b[y][mid]>x)
                    {
                        r = mid-1;
                        down = min(down,b[y][mid]);
                    }
                    else
                    {
                        l = mid+1;
                    }
                }
                //cout<<left<<" "<<right<<" "<<up<<" "<<down<<endl; 
                //cout<<y-left<<" "<<right-y<<" "<<x-up<<" "<<down-x<<endl; 
                ll tmp = (y-left)+(right-y)+(x-up)+(down-x)-3;
                //cout<<tmp<<endl;
                ans = max(ans,(y-left)+(right-y)+(x-up)+(down-x)-3);
            }
        }
    }
    cout<<ans;
    return 0;
}  

Measured memory_bytes: 71296