[h,w] = [int(i) for i in input().split()]
s = []
tate = [[0] * (h+2) for i in range(w+2)]
yoko = [[0] * (w+2) for i in range(h+2)]
s.append("#"*(w+2))
for i in range(h):
    tmp = input()
    s.append(tmp.join(["#","#"]))
s.append("#"*(w+2))

#横
for i in range(1,h+1):
    tmp = 1
    before = 1
    while tmp < w+2:
        if s[i][tmp] == "#":
            before += 1
            tmp += 1
        else:
            while s[i][tmp] != "#":
                tmp += 1
                if tmp == w+2:
                    break
            yoko[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp

for i in range(1,w+1):
    tmp = 1
    before = 1
    while tmp < h+2:
        if s[tmp][i] == "#":
            before += 1
            tmp += 1
        else:
            while s[tmp][i] != "#":
                tmp += 1
                if tmp == h+2:
                    break
            tate[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp
ans = 0
for i in range(1,h+1):
    for j in range(1,w+1):
        ans = max(ans,tate[j][i]+yoko[i][j]-1)
print(ans) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i [h,w] = [int(i) for i in input().split()] [h,w] h w [int(i) for i in input().split()] s = [] s [] [0] * (h+2) for i in range(w+2) for i in range(w+2) i range(w+2) range w+2 w 2 for i in range(w+2) [0] * (h+2) [0] 0 h+2 h 2 tate = [[0] * (h+2) for i in range(w+2)] tate [[0] * (h+2) for i in range(w+2)] [0] * (w+2) for i in range(h+2) for i in range(h+2) i range(h+2) range h+2 h 2 for i in range(h+2) [0] * (w+2) [0] 0 w+2 w 2 yoko = [[0] * (w+2) for i in range(h+2)] yoko [[0] * (w+2) for i in range(h+2)] s.append("#"*(w+2)) s.append s append "#"*(w+2) "#" w+2 w 2 for i in range(h):
    tmp = input()
    s.append(tmp.join(["#","#"])) i range(h) range h tmp = input() tmp input() input s.append(tmp.join(["#","#"])) s.append s append tmp.join(["#","#"]) tmp.join tmp join ["#","#"] "#" "#" s.append("#"*(w+2)) s.append s append "#"*(w+2) "#" w+2 w 2 for i in range(1,h+1):
    tmp = 1
    before = 1
    while tmp < w+2:
        if s[i][tmp] == "#":
            before += 1
            tmp += 1
        else:
            while s[i][tmp] != "#":
                tmp += 1
                if tmp == w+2:
                    break
            yoko[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp i range(1,h+1) range 1 h+1 h 1 tmp = 1 tmp 1 before = 1 before 1 while tmp < w+2:
        if s[i][tmp] == "#":
            before += 1
            tmp += 1
        else:
            while s[i][tmp] != "#":
                tmp += 1
                if tmp == w+2:
                    break
            yoko[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp tmp < w+2 tmp w+2 w 2 if s[i][tmp] == "#":
            before += 1
            tmp += 1
        else:
            while s[i][tmp] != "#":
                tmp += 1
                if tmp == w+2:
                    break
            yoko[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp s[i][tmp] == "#" s[i][tmp] [i] s i tmp "#" before += 1 before 1 tmp += 1 tmp 1 while s[i][tmp] != "#":
                tmp += 1
                if tmp == w+2:
                    break
             s[i][tmp] != "#" s[i][tmp] [i] s i tmp "#" tmp += 1 tmp 1 if tmp == w+2:
                    break
             tmp == w+2 tmp w+2 w 2 break yoko[i][before:tmp] = [tmp-before] * (tmp - before) yoko[i][before:tmp] [i] yoko i before:tmp before tmp [tmp-before] * (tmp - before) [tmp-before] tmp-before tmp before tmp - before tmp before before = tmp before tmp for i in range(1,w+1):
    tmp = 1
    before = 1
    while tmp < h+2:
        if s[tmp][i] == "#":
            before += 1
            tmp += 1
        else:
            while s[tmp][i] != "#":
                tmp += 1
                if tmp == h+2:
                    break
            tate[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp i range(1,w+1) range 1 w+1 w 1 tmp = 1 tmp 1 before = 1 before 1 while tmp < h+2:
        if s[tmp][i] == "#":
            before += 1
            tmp += 1
        else:
            while s[tmp][i] != "#":
                tmp += 1
                if tmp == h+2:
                    break
            tate[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp tmp < h+2 tmp h+2 h 2 if s[tmp][i] == "#":
            before += 1
            tmp += 1
        else:
            while s[tmp][i] != "#":
                tmp += 1
                if tmp == h+2:
                    break
            tate[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp s[tmp][i] == "#" s[tmp][i] [tmp] s tmp i "#" before += 1 before 1 tmp += 1 tmp 1 while s[tmp][i] != "#":
                tmp += 1
                if tmp == h+2:
                    break
             s[tmp][i] != "#" s[tmp][i] [tmp] s tmp i "#" tmp += 1 tmp 1 if tmp == h+2:
                    break
             tmp == h+2 tmp h+2 h 2 break tate[i][before:tmp] = [tmp-before] * (tmp - before) tate[i][before:tmp] [i] tate i before:tmp before tmp [tmp-before] * (tmp - before) [tmp-before] tmp-before tmp before tmp - before tmp before before = tmp before tmp ans = 0 ans 0 for i in range(1,h+1):
    for j in range(1,w+1):
        ans = max(ans,tate[j][i]+yoko[i][j]-1) i range(1,h+1) range 1 h+1 h 1 for j in range(1,w+1):
        ans = max(ans,tate[j][i]+yoko[i][j]-1) j range(1,w+1) range 1 w+1 w 1 ans = max(ans,tate[j][i]+yoko[i][j]-1) ans max(ans,tate[j][i]+yoko[i][j]-1) max ans tate[j][i]+yoko[i][j]-1 tate[j][i]+yoko[i][j] tate[j][i] [j] tate j i yoko[i][j] [i] yoko i j 1 print(ans) print ans tmp += 1 1 tmp tmp += 1 1 tmp ans = max(ans,tate[j][i]+yoko[i][j]-1) max(ans,tate[j][i]+yoko[i][j]-1) ans before = tmp tmp before tmp = 1 1 tmp before = 1 1 before before = 1 1 before before += 1 1 before s = [] [] s ans = 0 0 ans before = tmp tmp before tmp = input() input() tmp tmp += 1 1 tmp tmp += 1 1 tmp tmp = 1 1 tmp tate = [[0] * (h+2) for i in range(w+2)] [[0] * (h+2) for i in range(w+2)] tate before += 1 1 before yoko = [[0] * (w+2) for i in range(h+2)] [[0] * (w+2) for i in range(h+2)] yoko
[h,w] = [int(i) for i in input().split()]
s = []
tate = [[0] * (h+2) for i in range(w+2)]
yoko = [[0] * (w+2) for i in range(h+2)]
s.append("#"*(w+2))
for i in range(h):
    tmp = input()
    s.append(tmp.join(["#","#"]))
s.append("#"*(w+2))

#横
for i in range(1,h+1):
    tmp = 1
    before = 1
    while tmp < w+2:
        if s[i][tmp] == "#":
            before += 1
            tmp += 1
        else:
            while s[i][tmp] != "#":
                tmp += 1
                if tmp == w+2:
                    break
            yoko[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp

for i in range(1,w+1):
    tmp = 1
    before = 1
    while tmp < h+2:
        if s[tmp][i] == "#":
            before += 1
            tmp += 1
        else:
            while s[tmp][i] != "#":
                tmp += 1
                if tmp == h+2:
                    break
            tate[i][before:tmp] = [tmp-before] * (tmp - before)
            before = tmp
ans = 0
for i in range(1,h+1):
    for j in range(1,w+1):
        ans = max(ans,tate[j][i]+yoko[i][j]-1)
print(ans)
