Problem:
Score : 400 points

Problem Statement

There is a grid with H horizontal rows and W vertical columns, and there are obstacles on some of the squares.

Snuke is going to choose one of the squares not occupied by an obstacle and place a lamp on it.
The lamp placed on the square will emit straight beams of light in four cardinal directions: up, down, left, and right.
In each direction, the beam will continue traveling until it hits a square occupied by an obstacle or it hits the border of the grid. It will light all the squares on the way, including the square on which the lamp is placed, but not the square occupied by an obstacle.

Snuke wants to maximize the number of squares lighted by the lamp.

You are given H strings S_i (1 \leq i \leq H), each of length W. If the j-th character (1 \leq j \leq W) of S_i is #, there is an obstacle on the square at the i-th row from the top and the j-th column from the left; if that character is ., there is no obstacle on that square.

Find the maximum possible number of squares lighted by the lamp.

Constraints

1 \leq H \leq 2,000

1 \leq W \leq 2,000

S_i is a string of length W consisting of # and ..

. occurs at least once in one of the strings S_i (1 \leq i \leq H).

Input

Input is given from Standard Input in the following format:

H W
S_1
:
S_H

Output

Print the maximum possible number of squares lighted by the lamp.

Sample Input 1

4 6
#..#..
.....#
....#.
#.#...

Sample Output 1

8

If Snuke places the lamp on the square at the second row from the top and the second column from the left, it will light the following squares: the first through fifth squares from the left in the second row, and the first through fourth squares from the top in the second column, for a total of eight squares.

Sample Input 2

8 8
..#...#.
....#...
##......
..###..#
...#..#.
##....#.
#...#...
###.#..#

Sample Output 2

13

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}

int main() {
  int H,W;
  cin >> H >> W;
  v(v(char)) M(H,v(char)(W));
  rep(i,H) {
    rep(j,W) {
      cin >> M[i][j];
    }
    
  }
  //pair<int,P> ls;
  vector<pair<int,P>> wRank;
  vector<pair<int,P>> hRank;
  rep(i,H) {
    int start = INF;
    rep(j,W) {
      if(M[i][j] == '#') {
        if(start == INF) continue;
        wRank.emplace_back(make_pair(i,P(start,j-1)));
        start = INF;
      } else {
        if(start == INF) start = j;
      }
    }
    if(start != INF) wRank.emplace_back(make_pair(i,P(start,W-1)));
  }
  rep(i,W) {
    int start = INF;
    rep(j,H) {
      if(M[j][i] == '#') {
        if(start == INF) continue;
        hRank.emplace_back(make_pair(i,P(start,j-1)));
        start = INF;
      } else {
        if(start == INF) start = j;
      }
    }
    if(start != INF) hRank.emplace_back(make_pair(i,P(start,H-1)));
  }
  sort(rng(wRank),[](pair<int,P> &l,pair<int,P> &r) {
    return l.second.second - l.second.first > r.second.second - r.second.first;
  });
  sort(rng(hRank),[](pair<int,P> &l,pair<int,P> &r) {
    return l.second.second - l.second.first > r.second.second - r.second.first;
  });
  /*
  rep(i,sz(wRank)) {
    show(wRank[i].first);
    show(wRank[i].second.first);
    show(wRank[i].second.second);
  }*/
  int ans = -INF;
  rep(i,sz(wRank)) {
    rep(j,sz(hRank)) {
      int a = wRank[i].first;
      int al = wRank[i].second.first;
      int ar = wRank[i].second.second;
      int b = hRank[j].first;
      int bl = hRank[j].second.first;
      int br = hRank[j].second.second;
      if(a >=bl &&a <= br && b >= al && b <= br) {
          ans = max(ans,ar-al+br-bl);
      }
    }
  }
  cout << ans+1 << endl;
  return 0;
}