H,W = map(int,input().split())

S = [[] for _ in range(H)]
for i in range(H):
    S[i] = list(input())

HL = [[] for _ in range(H)]
WL = [[] for _ in range(W)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            HL[i].append(j)

for j in range(W):
    for i in range(H):
        if S[i][j] == '#':
            WL[j].append(i)
ma = 0
import bisect
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            ind = bisect.bisect_left(HL[i],j)
            if ind == 0:
                left = -1
            else:
                left = HL[i][ind-1]
            if ind == len(HL[i]):
                right = W
            else:
                right = HL[i][ind]
            wid_num = right-left-1

            ind_2 = bisect.bisect_left(WL[j],i)
            if ind_2 == 0:
                up = -1
            else:
                up = WL[j][ind_2-1]
            if ind_2 == len(WL[j]):
                down = H
            else:
                down = WL[j][ind_2]
            len_num = down-up-1

            ma = max(ma,wid_num+len_num-1)
print(ma)





 H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W [] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [] S = [[] for _ in range(H)] S [[] for _ in range(H)] for i in range(H):
    S[i] = list(input()) i range(H) range H S[i] = list(input()) S[i] S i list(input()) list input() input [] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [] HL = [[] for _ in range(H)] HL [[] for _ in range(H)] [] for _ in range(W) for _ in range(W) _ range(W) range W for _ in range(W) [] WL = [[] for _ in range(W)] WL [[] for _ in range(W)] for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            HL[i].append(j) i range(H) range H for j in range(W):
        if S[i][j] == '#':
            HL[i].append(j) j range(W) range W if S[i][j] == '#':
            HL[i].append(j) S[i][j] == '#' S[i][j] [i] S i j '#' HL[i].append(j) [i].append [i] HL i append j for j in range(W):
    for i in range(H):
        if S[i][j] == '#':
            WL[j].append(i) j range(W) range W for i in range(H):
        if S[i][j] == '#':
            WL[j].append(i) i range(H) range H if S[i][j] == '#':
            WL[j].append(i) S[i][j] == '#' S[i][j] [i] S i j '#' WL[j].append(i) [j].append [j] WL j append i ma = 0 ma 0 import bisect bisect for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            ind = bisect.bisect_left(HL[i],j)
            if ind == 0:
                left = -1
            else:
                left = HL[i][ind-1]
            if ind == len(HL[i]):
                right = W
            else:
                right = HL[i][ind]
            wid_num = right-left-1

            ind_2 = bisect.bisect_left(WL[j],i)
            if ind_2 == 0:
                up = -1
            else:
                up = WL[j][ind_2-1]
            if ind_2 == len(WL[j]):
                down = H
            else:
                down = WL[j][ind_2]
            len_num = down-up-1

            ma = max(ma,wid_num+len_num-1) i range(H) range H for j in range(W):
        if S[i][j] == '.':
            ind = bisect.bisect_left(HL[i],j)
            if ind == 0:
                left = -1
            else:
                left = HL[i][ind-1]
            if ind == len(HL[i]):
                right = W
            else:
                right = HL[i][ind]
            wid_num = right-left-1

            ind_2 = bisect.bisect_left(WL[j],i)
            if ind_2 == 0:
                up = -1
            else:
                up = WL[j][ind_2-1]
            if ind_2 == len(WL[j]):
                down = H
            else:
                down = WL[j][ind_2]
            len_num = down-up-1

            ma = max(ma,wid_num+len_num-1) j range(W) range W if S[i][j] == '.':
            ind = bisect.bisect_left(HL[i],j)
            if ind == 0:
                left = -1
            else:
                left = HL[i][ind-1]
            if ind == len(HL[i]):
                right = W
            else:
                right = HL[i][ind]
            wid_num = right-left-1

            ind_2 = bisect.bisect_left(WL[j],i)
            if ind_2 == 0:
                up = -1
            else:
                up = WL[j][ind_2-1]
            if ind_2 == len(WL[j]):
                down = H
            else:
                down = WL[j][ind_2]
            len_num = down-up-1

            ma = max(ma,wid_num+len_num-1) S[i][j] == '.' S[i][j] [i] S i j '.' ind = bisect.bisect_left(HL[i],j) ind bisect.bisect_left(HL[i],j) bisect.bisect_left bisect bisect_left HL[i] HL i j if ind == 0:
                left = -1
            else:
                left = HL[i][ind-1]
             ind == 0 ind 0 left = -1 left -1 left = HL[i][ind-1] left HL[i][ind-1] [i] HL i ind-1 ind 1 if ind == len(HL[i]):
                right = W
            else:
                right = HL[i][ind]
             ind == len(HL[i]) ind len(HL[i]) len HL[i] HL i right = W right W right = HL[i][ind] right HL[i][ind] [i] HL i ind wid_num = right-left-1 wid_num right-left-1 right-left right left 1 ind_2 = bisect.bisect_left(WL[j],i) ind_2 bisect.bisect_left(WL[j],i) bisect.bisect_left bisect bisect_left WL[j] WL j i if ind_2 == 0:
                up = -1
            else:
                up = WL[j][ind_2-1]
             ind_2 == 0 ind_2 0 up = -1 up -1 up = WL[j][ind_2-1] up WL[j][ind_2-1] [j] WL j ind_2-1 ind_2 1 if ind_2 == len(WL[j]):
                down = H
            else:
                down = WL[j][ind_2]
             ind_2 == len(WL[j]) ind_2 len(WL[j]) len WL[j] WL j down = H down H down = WL[j][ind_2] down WL[j][ind_2] [j] WL j ind_2 len_num = down-up-1 len_num down-up-1 down-up down up 1 ma = max(ma,wid_num+len_num-1) ma max(ma,wid_num+len_num-1) max ma wid_num+len_num-1 wid_num+len_num wid_num len_num 1 print(ma) print ma right = W W right left = HL[i][ind-1] HL[i][ind-1] left up = WL[j][ind_2-1] WL[j][ind_2-1] up ma = max(ma,wid_num+len_num-1) max(ma,wid_num+len_num-1) ma H,W = map(int,input().split()) map(int,input().split()) H HL = [[] for _ in range(H)] [[] for _ in range(H)] HL up = -1 -1 up WL = [[] for _ in range(W)] [[] for _ in range(W)] WL ma = 0 0 ma ind = bisect.bisect_left(HL[i],j) bisect.bisect_left(HL[i],j) ind S = [[] for _ in range(H)] [[] for _ in range(H)] S len_num = down-up-1 down-up-1 len_num left = -1 -1 left right = HL[i][ind] HL[i][ind] right down = WL[j][ind_2] WL[j][ind_2] down wid_num = right-left-1 right-left-1 wid_num ind_2 = bisect.bisect_left(WL[j],i) bisect.bisect_left(WL[j],i) ind_2 down = H H down W = map(int,input().split()) map(int,input().split()) W
H,W = map(int,input().split())

S = [[] for _ in range(H)]
for i in range(H):
    S[i] = list(input())

HL = [[] for _ in range(H)]
WL = [[] for _ in range(W)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            HL[i].append(j)

for j in range(W):
    for i in range(H):
        if S[i][j] == '#':
            WL[j].append(i)
ma = 0
import bisect
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            ind = bisect.bisect_left(HL[i],j)
            if ind == 0:
                left = -1
            else:
                left = HL[i][ind-1]
            if ind == len(HL[i]):
                right = W
            else:
                right = HL[i][ind]
            wid_num = right-left-1

            ind_2 = bisect.bisect_left(WL[j],i)
            if ind_2 == 0:
                up = -1
            else:
                up = WL[j][ind_2-1]
            if ind_2 == len(WL[j]):
                down = H
            else:
                down = WL[j][ind_2]
            len_num = down-up-1

            ma = max(ma,wid_num+len_num-1)
print(ma)






