h , w = map(int,input().split())
s = [input() for i in range(h)]
coulef = [[0 for i in range(w)] for j in range(h)]
courig = [[0 for i in range(w)] for j in range(h)]
coudow = [[0 for i in range(w)] for j in range(h)]
couup = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
    cou = 0
    for j in range(w):
        if s[i][j] == ".":
            cou += 1
            courig[i][j] = cou
        elif s[i][j] == "#":
            cou = 0
for i in range(h):
    cou = 0
    for j in reversed(range(w)):
        if s[i][j] == ".":
            cou += 1
            coulef[i][j] = cou
        elif s[i][j] == "#":
            cou = 0
for i in range(w):
    cou = 0
    for j in range(h):
        if s[j][i] == ".":
            cou += 1
            coudow[j][i] = cou
        elif s[j][i] == "#":
            cou = 0
for i in range(w):
    cou = 0
    for j in reversed(range(h)):
        if s[j][i] == ".":
            cou += 1
            couup[j][i] = cou
        elif s[j][i] == "#":
            cou = 0

ans = 0
for i in range(h):
    for j in range(w):
        now = couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j]
        ans = max(ans,now-3)
print(ans) h , w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w input() for i in range(h) for i in range(h) i range(h) range h for i in range(h) input() input s = [input() for i in range(h)] s [input() for i in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] coulef = [[0 for i in range(w)] for j in range(h)] coulef [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] courig = [[0 for i in range(w)] for j in range(h)] courig [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] coudow = [[0 for i in range(w)] for j in range(h)] coudow [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] couup = [[0 for i in range(w)] for j in range(h)] couup [[0 for i in range(w)] for j in range(h)] for i in range(h):
    cou = 0
    for j in range(w):
        if s[i][j] == ".":
            cou += 1
            courig[i][j] = cou
        elif s[i][j] == "#":
            cou = 0 i range(h) range h cou = 0 cou 0 for j in range(w):
        if s[i][j] == ".":
            cou += 1
            courig[i][j] = cou
        elif s[i][j] == "#":
            cou = 0 j range(w) range w if s[i][j] == ".":
            cou += 1
            courig[i][j] = cou
        elif s[i][j] == "#":
            cou = 0 s[i][j] == "." s[i][j] [i] s i j "." cou += 1 cou 1 courig[i][j] = cou courig[i][j] [i] courig i j cou elif s[i][j] == "#":
            cou = 0 s[i][j] == "#" s[i][j] [i] s i j "#" cou = 0 cou 0 for i in range(h):
    cou = 0
    for j in reversed(range(w)):
        if s[i][j] == ".":
            cou += 1
            coulef[i][j] = cou
        elif s[i][j] == "#":
            cou = 0 i range(h) range h cou = 0 cou 0 for j in reversed(range(w)):
        if s[i][j] == ".":
            cou += 1
            coulef[i][j] = cou
        elif s[i][j] == "#":
            cou = 0 j reversed(range(w)) reversed range(w) range w if s[i][j] == ".":
            cou += 1
            coulef[i][j] = cou
        elif s[i][j] == "#":
            cou = 0 s[i][j] == "." s[i][j] [i] s i j "." cou += 1 cou 1 coulef[i][j] = cou coulef[i][j] [i] coulef i j cou elif s[i][j] == "#":
            cou = 0 s[i][j] == "#" s[i][j] [i] s i j "#" cou = 0 cou 0 for i in range(w):
    cou = 0
    for j in range(h):
        if s[j][i] == ".":
            cou += 1
            coudow[j][i] = cou
        elif s[j][i] == "#":
            cou = 0 i range(w) range w cou = 0 cou 0 for j in range(h):
        if s[j][i] == ".":
            cou += 1
            coudow[j][i] = cou
        elif s[j][i] == "#":
            cou = 0 j range(h) range h if s[j][i] == ".":
            cou += 1
            coudow[j][i] = cou
        elif s[j][i] == "#":
            cou = 0 s[j][i] == "." s[j][i] [j] s j i "." cou += 1 cou 1 coudow[j][i] = cou coudow[j][i] [j] coudow j i cou elif s[j][i] == "#":
            cou = 0 s[j][i] == "#" s[j][i] [j] s j i "#" cou = 0 cou 0 for i in range(w):
    cou = 0
    for j in reversed(range(h)):
        if s[j][i] == ".":
            cou += 1
            couup[j][i] = cou
        elif s[j][i] == "#":
            cou = 0 i range(w) range w cou = 0 cou 0 for j in reversed(range(h)):
        if s[j][i] == ".":
            cou += 1
            couup[j][i] = cou
        elif s[j][i] == "#":
            cou = 0 j reversed(range(h)) reversed range(h) range h if s[j][i] == ".":
            cou += 1
            couup[j][i] = cou
        elif s[j][i] == "#":
            cou = 0 s[j][i] == "." s[j][i] [j] s j i "." cou += 1 cou 1 couup[j][i] = cou couup[j][i] [j] couup j i cou elif s[j][i] == "#":
            cou = 0 s[j][i] == "#" s[j][i] [j] s j i "#" cou = 0 cou 0 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        now = couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j]
        ans = max(ans,now-3) i range(h) range h for j in range(w):
        now = couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j]
        ans = max(ans,now-3) j range(w) range w now = couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j] now couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j] couup[i][j]+coudow[i][j]+coulef[i][j] couup[i][j]+coudow[i][j] couup[i][j] [i] couup i j coudow[i][j] [i] coudow i j coulef[i][j] [i] coulef i j courig[i][j] [i] courig i j ans = max(ans,now-3) ans max(ans,now-3) max ans now-3 now 3 print(ans) print ans ans = max(ans,now-3) max(ans,now-3) ans coudow = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] coudow coulef = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] coulef cou = 0 0 cou courig = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] courig now = couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j] couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j] now h , w = map(int,input().split()) map(int,input().split()) h cou += 1 1 cou cou = 0 0 cou ans = 0 0 ans cou = 0 0 cou cou = 0 0 cou cou = 0 0 cou cou += 1 1 cou s = [input() for i in range(h)] [input() for i in range(h)] s cou += 1 1 cou couup = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] couup cou += 1 1 cou cou = 0 0 cou w = map(int,input().split()) map(int,input().split()) w cou = 0 0 cou cou = 0 0 cou
h , w = map(int,input().split())
s = [input() for i in range(h)]
coulef = [[0 for i in range(w)] for j in range(h)]
courig = [[0 for i in range(w)] for j in range(h)]
coudow = [[0 for i in range(w)] for j in range(h)]
couup = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
    cou = 0
    for j in range(w):
        if s[i][j] == ".":
            cou += 1
            courig[i][j] = cou
        elif s[i][j] == "#":
            cou = 0
for i in range(h):
    cou = 0
    for j in reversed(range(w)):
        if s[i][j] == ".":
            cou += 1
            coulef[i][j] = cou
        elif s[i][j] == "#":
            cou = 0
for i in range(w):
    cou = 0
    for j in range(h):
        if s[j][i] == ".":
            cou += 1
            coudow[j][i] = cou
        elif s[j][i] == "#":
            cou = 0
for i in range(w):
    cou = 0
    for j in reversed(range(h)):
        if s[j][i] == ".":
            cou += 1
            couup[j][i] = cou
        elif s[j][i] == "#":
            cou = 0

ans = 0
for i in range(h):
    for j in range(w):
        now = couup[i][j]+coudow[i][j]+coulef[i][j]+courig[i][j]
        ans = max(ans,now-3)
print(ans)