/*
g++ -std=c++14 -O2 -Wall a.cpp -o a && a
*/

//  io
#include <iostream>
//#include <fstream> //http://www.cplusplus.com/reference/fstream/fstream/
//#include <cstdio>
//#include <iomanip> //http://www.cplusplus.com/reference/iomanip/
//  util
#include <string>
#include <cstring>
#include <algorithm>
//#include <utility>
//#include <functional> //http://www.cplusplus.com/reference/functional/
//#include <cstdlib>
//#include <cmath>
//#include <complex>
//#include <random>
//#include <bitset>
//  containers https://en.cppreference.com/w/cpp/container
#include <vector>
//#include <queue>
//#include <set>
//#include <map>
//#include <unordered_set>
//#include <unordered_map>
//  time
//#include <ctime>
//#include <chrono>
//                  https://en.cppreference.com/w/cpp/header/chrono
//                  http://www.cplusplus.com/reference/chrono/

using namespace std;
typedef vector<int> arri;
typedef vector<float> arrf;
typedef pair<int, int> pairi;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 0x7fffffffffffffff;
const ll infneg = -0x7fffffffffffffff;

//int modadd(int a, int b) { return ((a += b) < mod) ? a : (a - mod); }
//int modmult(int a, int b) { return (int)((a * b) % mod) }

//file input routed to stdinout
/*
std::ifstream inFile("input.txt");
std::ofstream outFile("output.txt");
std::cin.rdbuf(inFile.rdbuf());
std::cout.rdbuf(outFile.rdbuf());
*/

int horiz[2001][2001];
int vert[2001][2001];
string field[2001];

void backtrackVert(int &j, int aux, int &prev)
{
    while (aux >= 0 && field[aux][j] != '#')
    {
        vert[aux--][j] = prev;
    }
}

void backtrackHoriz(int &j, int aux, int &prev)
{
    while (aux >= 0 && field[j][aux] != '#')
    {
        horiz[j][aux--] = prev;
    }
}

int main()
{
    //auto begin = chrono::system_clock::now();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    memset(horiz, 0, sizeof(int) * 2001 * 2001);
    memset(vert, 0, sizeof(int) * 2001 * 2001);

    int H, W;
    cin >> H >> W;

    for (int i = 0; i < H; i++)
    {
        cin >> field[i];
    }
    for (int j = 0; j < H; j++)
    {
        int prev = 0;
        int i = 0;
        for (; i < W; i++)
        {
            if (field[j][i] == '#')
            {
                backtrackHoriz(j, i - 1, prev);
                prev = 0;
                horiz[j][i] = 0;
            }
            else
            {
                prev++;
                horiz[j][i] = prev;
            }
        }
        backtrackHoriz(j, i - 1, prev);
    }
    for (int j = 0; j < W; j++)
    {
        int prev = 0;
        int i = 0;
        for (; i < H; i++)
        {
            if (field[i][j] == '#')
            {
                backtrackVert(j, i - 1, prev);
                prev = 0;
                vert[i][j] = 0;
            }
            else
            {
                prev++;
                vert[i][j] = prev;
            }
        }
        backtrackVert(j, i - 1, prev);
    }

    int out = 0;

    for (int j = 0; j < H; j++)
    {
        for (int i = 0; i < W; i++)
        {
            out = max(out, horiz[j][i] + vert[j][i]);
        }
    }

    cout << out - 1;
    //auto end = chrono::system_clock::now();
    //cout << endl;
    //cout << chrono::duration_cast<chrono::milliseconds>(end - begin).count();
}


Measured memory_bytes: 35840