h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
u_light = [[0]*w for _ in range(h)] #上をてらせる数
d_light = [[0]*w for _ in range(h)] #下
l_light = [[0]*w for _ in range(h)] #左
r_light = [[0]*w for _ in range(h)] #右

def count_light(i, j):
    if s[i][j] == '.':
        return 1
    else:
        return -10000

for i in range(w):
    d_light[-1][i] = count_light(-1, i)
    u_light[0][i] = count_light(0, i)
for j in range(1, h):
    for i in range(w):
        d_light[-(j+1)][i] = max(d_light[-j][i], 0) + count_light(-(j+1), i)
        u_light[j][i] = max(u_light[j-1][i], 0) + count_light(j, i)

for i in range(h):
    l_light[i][0] = count_light(i, 0)
    r_light[i][-1] = count_light(i, -1)
for j in range(1, w):
    for i in range(h):
        l_light[i][j] = max(l_light[i][j-1], 0) + count_light(i, j)
        r_light[i][-(j+1)] = max(r_light[i][-j], 0) + count_light(i, -(j+1))

score = 0
tmp_score = 0
for i in range(h):
    for j in range(w):
        tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j]
        if tmp_score > score:
            score = tmp_score
print(score-3) # 3回ダブっているので除去 h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w list(input()) for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) list(input()) list input() input s = [list(input()) for _ in range(h)] s [list(input()) for _ in range(h)] [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w u_light = [[0]*w for _ in range(h)] u_light [[0]*w for _ in range(h)] [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w d_light = [[0]*w for _ in range(h)] d_light [[0]*w for _ in range(h)] [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w l_light = [[0]*w for _ in range(h)] l_light [[0]*w for _ in range(h)] [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w r_light = [[0]*w for _ in range(h)] r_light [[0]*w for _ in range(h)] def count_light(i, j):
    if s[i][j] == '.':
        return 1
    else:
        return -10000 count_light if s[i][j] == '.':
        return 1
    else:
        return -10000 s[i][j] == '.' s[i][j] [i] s i j '.' return 1 1 return -10000 -10000 i i j j for i in range(w):
    d_light[-1][i] = count_light(-1, i)
    u_light[0][i] = count_light(0, i) i range(w) range w d_light[-1][i] = count_light(-1, i) d_light[-1][i] [-1] d_light -1 i count_light(-1, i) count_light -1 i u_light[0][i] = count_light(0, i) u_light[0][i] [0] u_light 0 i count_light(0, i) count_light 0 i for j in range(1, h):
    for i in range(w):
        d_light[-(j+1)][i] = max(d_light[-j][i], 0) + count_light(-(j+1), i)
        u_light[j][i] = max(u_light[j-1][i], 0) + count_light(j, i) j range(1, h) range 1 h for i in range(w):
        d_light[-(j+1)][i] = max(d_light[-j][i], 0) + count_light(-(j+1), i)
        u_light[j][i] = max(u_light[j-1][i], 0) + count_light(j, i) i range(w) range w d_light[-(j+1)][i] = max(d_light[-j][i], 0) + count_light(-(j+1), i) d_light[-(j+1)][i] [-(j+1)] d_light -(j+1) j+1 j 1 i max(d_light[-j][i], 0) + count_light(-(j+1), i) max(d_light[-j][i], 0) max d_light[-j][i] [-j] d_light -j j i 0 count_light(-(j+1), i) count_light -(j+1) j+1 j 1 i u_light[j][i] = max(u_light[j-1][i], 0) + count_light(j, i) u_light[j][i] [j] u_light j i max(u_light[j-1][i], 0) + count_light(j, i) max(u_light[j-1][i], 0) max u_light[j-1][i] [j-1] u_light j-1 j 1 i 0 count_light(j, i) count_light j i for i in range(h):
    l_light[i][0] = count_light(i, 0)
    r_light[i][-1] = count_light(i, -1) i range(h) range h l_light[i][0] = count_light(i, 0) l_light[i][0] [i] l_light i 0 count_light(i, 0) count_light i 0 r_light[i][-1] = count_light(i, -1) r_light[i][-1] [i] r_light i -1 count_light(i, -1) count_light i -1 for j in range(1, w):
    for i in range(h):
        l_light[i][j] = max(l_light[i][j-1], 0) + count_light(i, j)
        r_light[i][-(j+1)] = max(r_light[i][-j], 0) + count_light(i, -(j+1)) j range(1, w) range 1 w for i in range(h):
        l_light[i][j] = max(l_light[i][j-1], 0) + count_light(i, j)
        r_light[i][-(j+1)] = max(r_light[i][-j], 0) + count_light(i, -(j+1)) i range(h) range h l_light[i][j] = max(l_light[i][j-1], 0) + count_light(i, j) l_light[i][j] [i] l_light i j max(l_light[i][j-1], 0) + count_light(i, j) max(l_light[i][j-1], 0) max l_light[i][j-1] [i] l_light i j-1 j 1 0 count_light(i, j) count_light i j r_light[i][-(j+1)] = max(r_light[i][-j], 0) + count_light(i, -(j+1)) r_light[i][-(j+1)] [i] r_light i -(j+1) j+1 j 1 max(r_light[i][-j], 0) + count_light(i, -(j+1)) max(r_light[i][-j], 0) max r_light[i][-j] [i] r_light i -j j 0 count_light(i, -(j+1)) count_light i -(j+1) j+1 j 1 score = 0 score 0 tmp_score = 0 tmp_score 0 for i in range(h):
    for j in range(w):
        tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j]
        if tmp_score > score:
            score = tmp_score i range(h) range h for j in range(w):
        tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j]
        if tmp_score > score:
            score = tmp_score j range(w) range w tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j] tmp_score u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j] u_light[i][j] + d_light[i][j] + l_light[i][j] u_light[i][j] + d_light[i][j] u_light[i][j] [i] u_light i j d_light[i][j] [i] d_light i j l_light[i][j] [i] l_light i j r_light[i][j] [i] r_light i j if tmp_score > score:
            score = tmp_score tmp_score > score tmp_score score score = tmp_score score tmp_score print(score-3) print score-3 score 3 tmp_score = 0 0 tmp_score l_light = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] l_light r_light = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] r_light s = [list(input()) for _ in range(h)] [list(input()) for _ in range(h)] s d_light = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] d_light def count_light(i, j):
    if s[i][j] == '.':
        return 1
    else:
        return -10000 def count_light(i, j):
    if s[i][j] == '.':
        return 1
    else:
        return -10000 count_light score = tmp_score tmp_score score tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j] u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j] tmp_score w = map(int, input().split()) map(int, input().split()) w u_light = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] u_light score = 0 0 score h, w = map(int, input().split()) map(int, input().split()) h
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
u_light = [[0]*w for _ in range(h)] #上をてらせる数
d_light = [[0]*w for _ in range(h)] #下
l_light = [[0]*w for _ in range(h)] #左
r_light = [[0]*w for _ in range(h)] #右

def count_light(i, j):
    if s[i][j] == '.':
        return 1
    else:
        return -10000

for i in range(w):
    d_light[-1][i] = count_light(-1, i)
    u_light[0][i] = count_light(0, i)
for j in range(1, h):
    for i in range(w):
        d_light[-(j+1)][i] = max(d_light[-j][i], 0) + count_light(-(j+1), i)
        u_light[j][i] = max(u_light[j-1][i], 0) + count_light(j, i)

for i in range(h):
    l_light[i][0] = count_light(i, 0)
    r_light[i][-1] = count_light(i, -1)
for j in range(1, w):
    for i in range(h):
        l_light[i][j] = max(l_light[i][j-1], 0) + count_light(i, j)
        r_light[i][-(j+1)] = max(r_light[i][-j], 0) + count_light(i, -(j+1))

score = 0
tmp_score = 0
for i in range(h):
    for j in range(w):
        tmp_score = u_light[i][j] + d_light[i][j] + l_light[i][j] + r_light[i][j]
        if tmp_score > score:
            score = tmp_score
print(score-3) # 3回ダブっているので除去
