import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    h,w = map(int,ipt().split())
    s = [""]*h+["#"*(w+1)]
    for i in range(h):
        s[i] = input()+"#"
    l = [[0]*(w+1) for _ in [0]*(h+1)]
    r = [[0]*(w+1) for _ in [0]*(h+1)]
    u = [[0]*(w+1) for _ in [0]*(h+1)]
    d = [[0]*(w+1) for _ in [0]*(h+1)]
    sm = [[-3]*(w+1) for _ in [0]*(h+1)]
    for i in range(h):
        si = sm[i]
        li = l[i]
        ui = u[i]
        for j in range(w):
            if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
    ma = 0
    for i in range(h):
        ri = r[h-i-1]
        si = sm[h-i-1]
        di = d[h-i-1]
        for j in range(w):
            if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
    print(ma)


    return

if __name__ == '__main__':
    main() import math math import queue queue from collections import deque,defaultdict import heapq heapq from sys import stdin,setrecursionlimit ipt = stdin.readline ipt stdin.readline stdin readline setrecursionlimit(10**7) setrecursionlimit 10**7 10 7 def main():
    h,w = map(int,ipt().split())
    s = [""]*h+["#"*(w+1)]
    for i in range(h):
        s[i] = input()+"#"
    l = [[0]*(w+1) for _ in [0]*(h+1)]
    r = [[0]*(w+1) for _ in [0]*(h+1)]
    u = [[0]*(w+1) for _ in [0]*(h+1)]
    d = [[0]*(w+1) for _ in [0]*(h+1)]
    sm = [[-3]*(w+1) for _ in [0]*(h+1)]
    for i in range(h):
        si = sm[i]
        li = l[i]
        ui = u[i]
        for j in range(w):
            if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
    ma = 0
    for i in range(h):
        ri = r[h-i-1]
        si = sm[h-i-1]
        di = d[h-i-1]
        for j in range(w):
            if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
    print(ma)


    return main h,w = map(int,ipt().split()) h map(int,ipt().split()) map int ipt().split() ().split () ipt split w s = [""]*h+["#"*(w+1)] s [""]*h+["#"*(w+1)] [""]*h [""] "" h ["#"*(w+1)] "#"*(w+1) "#" w+1 w 1 for i in range(h):
        s[i] = input()+"#"
     i range(h) range h s[i] = input()+"#" s[i] s i input()+"#" input() input "#" [0]*(w+1) for _ in [0]*(h+1) for _ in [0]*(h+1) _ [0]*(h+1) [0] 0 h+1 h 1 for _ in [0]*(h+1) [0]*(w+1) [0] 0 w+1 w 1 l = [[0]*(w+1) for _ in [0]*(h+1)] l [[0]*(w+1) for _ in [0]*(h+1)] [0]*(w+1) for _ in [0]*(h+1) for _ in [0]*(h+1) _ [0]*(h+1) [0] 0 h+1 h 1 for _ in [0]*(h+1) [0]*(w+1) [0] 0 w+1 w 1 r = [[0]*(w+1) for _ in [0]*(h+1)] r [[0]*(w+1) for _ in [0]*(h+1)] [0]*(w+1) for _ in [0]*(h+1) for _ in [0]*(h+1) _ [0]*(h+1) [0] 0 h+1 h 1 for _ in [0]*(h+1) [0]*(w+1) [0] 0 w+1 w 1 u = [[0]*(w+1) for _ in [0]*(h+1)] u [[0]*(w+1) for _ in [0]*(h+1)] [0]*(w+1) for _ in [0]*(h+1) for _ in [0]*(h+1) _ [0]*(h+1) [0] 0 h+1 h 1 for _ in [0]*(h+1) [0]*(w+1) [0] 0 w+1 w 1 d = [[0]*(w+1) for _ in [0]*(h+1)] d [[0]*(w+1) for _ in [0]*(h+1)] [-3]*(w+1) for _ in [0]*(h+1) for _ in [0]*(h+1) _ [0]*(h+1) [0] 0 h+1 h 1 for _ in [0]*(h+1) [-3]*(w+1) [-3] -3 w+1 w 1 sm = [[-3]*(w+1) for _ in [0]*(h+1)] sm [[-3]*(w+1) for _ in [0]*(h+1)] for i in range(h):
        si = sm[i]
        li = l[i]
        ui = u[i]
        for j in range(w):
            if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
     i range(h) range h si = sm[i] si sm[i] sm i li = l[i] li l[i] l i ui = u[i] ui u[i] u i for j in range(w):
            if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
     j range(w) range w if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
     s[i][j] == "#" s[i][j] [i] s i j "#" continue li[j] = l[i-1][j]+1 li[j] li j l[i-1][j]+1 l[i-1][j] [i-1] l i-1 i 1 j 1 ui[j] = ui[j-1]+1 ui[j] ui j ui[j-1]+1 ui[j-1] ui j-1 j 1 1 si[j] += li[j]+ui[j] si[j] si j li[j]+ui[j] li[j] li j ui[j] ui j ma = 0 ma 0 for i in range(h):
        ri = r[h-i-1]
        si = sm[h-i-1]
        di = d[h-i-1]
        for j in range(w):
            if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
     i range(h) range h ri = r[h-i-1] ri r[h-i-1] r h-i-1 h-i h i 1 si = sm[h-i-1] si sm[h-i-1] sm h-i-1 h-i h i 1 di = d[h-i-1] di d[h-i-1] d h-i-1 h-i h i 1 for j in range(w):
            if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
     j range(w) range w if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
     s[h-i-1][w-j-1] == "#" s[h-i-1][w-j-1] [h-i-1] s h-i-1 h-i h i 1 w-j-1 w-j w j 1 "#" continue ri[w-j-1] = r[h-i][w-j-1]+1 ri[w-j-1] ri w-j-1 w-j w j 1 r[h-i][w-j-1]+1 r[h-i][w-j-1] [h-i] r h-i h i w-j-1 w-j w j 1 1 di[w-j-1] = di[w-j]+1 di[w-j-1] di w-j-1 w-j w j 1 di[w-j]+1 di[w-j] di w-j w j 1 si[w-j-1] += ri[w-j-1]+di[w-j-1] si[w-j-1] si w-j-1 w-j w j 1 ri[w-j-1]+di[w-j-1] ri[w-j-1] ri w-j-1 w-j w j 1 di[w-j-1] di w-j-1 w-j w j 1 if ma < si[w-j-1]:
                    ma = si[w-j-1]
     ma < si[w-j-1] ma si[w-j-1] si w-j-1 w-j w j 1 ma = si[w-j-1] ma si[w-j-1] si w-j-1 w-j w j 1 print(ma) print ma return if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main ipt = stdin.readline stdin.readline ipt def main():
    h,w = map(int,ipt().split())
    s = [""]*h+["#"*(w+1)]
    for i in range(h):
        s[i] = input()+"#"
    l = [[0]*(w+1) for _ in [0]*(h+1)]
    r = [[0]*(w+1) for _ in [0]*(h+1)]
    u = [[0]*(w+1) for _ in [0]*(h+1)]
    d = [[0]*(w+1) for _ in [0]*(h+1)]
    sm = [[-3]*(w+1) for _ in [0]*(h+1)]
    for i in range(h):
        si = sm[i]
        li = l[i]
        ui = u[i]
        for j in range(w):
            if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
    ma = 0
    for i in range(h):
        ri = r[h-i-1]
        si = sm[h-i-1]
        di = d[h-i-1]
        for j in range(w):
            if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
    print(ma)


    return def main():
    h,w = map(int,ipt().split())
    s = [""]*h+["#"*(w+1)]
    for i in range(h):
        s[i] = input()+"#"
    l = [[0]*(w+1) for _ in [0]*(h+1)]
    r = [[0]*(w+1) for _ in [0]*(h+1)]
    u = [[0]*(w+1) for _ in [0]*(h+1)]
    d = [[0]*(w+1) for _ in [0]*(h+1)]
    sm = [[-3]*(w+1) for _ in [0]*(h+1)]
    for i in range(h):
        si = sm[i]
        li = l[i]
        ui = u[i]
        for j in range(w):
            if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
    ma = 0
    for i in range(h):
        ri = r[h-i-1]
        si = sm[h-i-1]
        di = d[h-i-1]
        for j in range(w):
            if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
    print(ma)


    return main
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    h,w = map(int,ipt().split())
    s = [""]*h+["#"*(w+1)]
    for i in range(h):
        s[i] = input()+"#"
    l = [[0]*(w+1) for _ in [0]*(h+1)]
    r = [[0]*(w+1) for _ in [0]*(h+1)]
    u = [[0]*(w+1) for _ in [0]*(h+1)]
    d = [[0]*(w+1) for _ in [0]*(h+1)]
    sm = [[-3]*(w+1) for _ in [0]*(h+1)]
    for i in range(h):
        si = sm[i]
        li = l[i]
        ui = u[i]
        for j in range(w):
            if s[i][j] == "#":
                continue
            else:
                li[j] = l[i-1][j]+1
                ui[j] = ui[j-1]+1
                si[j] += li[j]+ui[j]
    ma = 0
    for i in range(h):
        ri = r[h-i-1]
        si = sm[h-i-1]
        di = d[h-i-1]
        for j in range(w):
            if s[h-i-1][w-j-1] == "#":
                continue
            else:
                ri[w-j-1] = r[h-i][w-j-1]+1
                di[w-j-1] = di[w-j]+1
                si[w-j-1] += ri[w-j-1]+di[w-j-1]
                if ma < si[w-j-1]:
                    ma = si[w-j-1]
    print(ma)


    return

if __name__ == '__main__':
    main()
