/////////////////////////////////
//                             //
//           /(.^.)\           //
//                             //
/////////////////////////////////

#include <stdio.h>

#define BYTE unsigned char
#define DWORD unsigned int
#define LL long long
#define SD(x) scanf("%d", &(x))

#define HHH 2002
#define WWW 2002

BYTE s[HHH*WWW];


void xxxxxprintfxxxxx(int a, int b = -2, int c = -2, int d = -2);


//main
int main()
{
    int retn;

    int h,w;

    char buf[WWW];
    char *pbuf;

    int tmp,tmp2,tmp3;
    int l,r,u,d;
    int max;


    SD(h);
    SD(w);

    max = h + w - 1;

    for (int ih = 1; ih <= h; ++ih)
    {
        scanf("%s" ,buf);

        pbuf = buf;
        for (int iw = 1; iw <= w; ++iw)
        {
            if (*pbuf == '#')
            {
                s[ih*WWW+iw] = 1;
            }
            else
            {
                s[ih*WWW+iw] = 0;
            }
            ++pbuf;
        }

        s[ih*WWW]     = 1; //外周を1で埋める(左)
        s[ih*WWW+w+1] = 1; //外周を1で埋める(右)
    }

    //外周を1で埋める(上下)
    for (int iw = 0; iw <= w+1; ++iw)
    {
        s[iw] = 1;
        s[(h+1)*WWW+iw] = 1;
    }


    /////////////////////////////////////////////
    // for (int ih = 0; ih <= h + 1; ++ih)
    // {
    //     for (int iw = 0; iw <= w + 1; ++iw)
    //     {
    //         printf("%d ", s[ih*WWW+iw]);
    //     }
    //     printf("\n");
    // }

    retn = 0;

    for (int ih = 1; ih <= h; ++ih)
    {
        l = 0;
        for (int iw = 1; iw <= w; ++iw)
        {
            tmp = ih*WWW+iw;
            if (!s[tmp]) //0
            {
                ++l;

                r = 0;
                tmp2 = tmp + 1;
                while (!s[tmp2])
                {
                    ++r;
                    ++tmp2;
                }

                u = 0;
                tmp2 = tmp - WWW;
                while (!s[tmp2])
                {
                    ++u;
                    tmp2 -= WWW;
                }

                d = 0;
                tmp2 = tmp + WWW;
                while (!s[tmp2])
                {
                    ++d;
                    tmp2 += WWW;
                }

                tmp3 = l + r + u + d;

                if (tmp3 == max)
                {
                    retn = tmp3;
                    //hard break
                    ih = h + 1;
                    iw = w + 1;

                    // xxxxxprintfxxxxx(tmp);
                    // xxxxxprintfxxxxx(l,r,u,d);
                }
                else if (tmp3 > retn)
                {
                    // xxxxxprintfxxxxx(tmp);
                    // xxxxxprintfxxxxx(l,r,u,d);
                    retn = tmp3;
                }
            }
            else //1
            {
                l = 0;
            }
        }
    }

    printf("%d", retn);
    //printf("/(.^.)\\\n");

    return 0;
}


void xxxxxprintfxxxxx(int a, int b, int c, int d)
{
    if (b == -2)
    {
        printf("%d\n", a);
    }
    else if (c == -2)
    {
        printf("%d %d\n", a, b);
    }
    else if (d == -2)
    {
        printf("%d %d %d\n", a, b, c);
    }
    else
    {
        printf("%d %d %d %d\n", a, b, c ,d);
    }

    return;
}

Measured memory_bytes: 4096