#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int H, W;
vector<string> field;
vector<vector<int> > field_count1;
vector<vector<int> > field_count2;
vector<vector<bool> > seen;

const int dh[4]={1, 0, -1, 0};
const int dw[4]={0, 1, 0, -1};

int dfs(int h, int w, int which_way_to_go) {
    seen[h][w] = true;

    // which way to go
    // 4: start, 2: go left, 0: go right, 1: go up, 3: go down
    int count=0;
    if(which_way_to_go==4) {
        for(int dir=0; dir<4; dir++) {
            int nh = h+dh[dir];
            int nw = w+dw[dir];
            
            if(nh<0 || nh>=H || nw<0 || nw>=W) continue;
            if(field[nh][nw]=='#') continue;
            if(seen[nh][nw]) continue;
            count += dfs(nh, nw, dir);
        }
    } else {
        int nh = h+dh[which_way_to_go];
        int nw = w+dw[which_way_to_go];
        
        if(nh<0 || nh>=H || nw<0 || nw>=W) {
            ;
        } else {
            if(field[nh][nw]=='#' || seen[nh][nw]) {
                ;
            } else {
                count += dfs(nh, nw, which_way_to_go);
            }
        }
    }
    
    return count+1;
}

int main() {
    cin >> H >> W;
    field.resize(H);
    field_count1.assign(H, vector<int>(W, 0));
    field_count2.assign(H, vector<int>(W, 0));
    
    for(int h=0; h<H; h++) {
        cin >> field[h];
    }

    // for(int h=0; h<H; h++) {
    //     // cout << "h = " << h << endl;
    //     for(int w=0; w<W; w++) {
    //         // cout << "w = " << w ;
    //         if(field[h][w]=='#') continue;
    //         if(seen[h][w]) continue;
    //         // seen.assign(H, vector<bool>(W, false));

    //         // cout << " max_count = " << max_count << " -> ";
    //         dfs(h, w, 0)
    //         // cout << max_count << endl;
    //     }
    //     // cout << endl;
    // }

    int count;
    for(int h=0; h<H; h++) {
        count = 0;
        for(int w=0; w<W; w++) {
            if(field[h][w]=='#') {
                count = 0;
            } else {
                field_count1[h][w] = count;
                count++;
            }
            // cout << "h, w = " << h << ", " << w;
            // cout << " " << field_count1[h][w] << endl;
        }
    }

    for(int h=0; h<H; h++) {
        for(int w=W-1; w>=0; w--) {
            if(field[h][w]=='#') {
                if(w>1) {
                    count = field_count1[h][w-1];
                }
            } else if(w==W-1) {
                count = field_count1[h][w];
            } else {
                field_count1[h][w] = count;
            }
            // cout << "h, w = " << h << ", " << w;
            // cout << " " << field_count1[h][w] << endl;
        }
    }

    for(int w=0; w<W; w++) {
        count = 0;
        for(int h=0; h<H; h++) {
            if(field[h][w]=='#') {
                count = 0;
            } else {
                field_count2[h][w] = count;
                count++;
            }
        }
    }

    for(int w=0; w<W; w++) {
        for(int h=H-1; h>=0; h--) {
            if(field[h][w]=='#') {
                if(h>1) {
                    count = field_count2[h-1][w];
                }
            } else if (h==H-1) {
                count = field_count2[h][w];
            }else {
                field_count2[h][w] = count;
            }
        }
    }

    int ans=0;
    for(int h=0; h<H; h++) {
        for(int w=0; w<W; w++) {
            if(field[h][w]=='#') continue;
            ans = max(ans, field_count1[h][w]+field_count2[h][w]+1);
        }
    }
    
    cout << ans << endl;


    return 0;
    
}

Measured memory_bytes: 35712