h,w = map(int,input().split())
s =["#"*(w+2)] + ["#"+input()+"#" for i in range(h)] + ["#"*(w+2)]
# print(s)
ans = 1
opt = [(0,1),(0,-1),(1,0),(-1,0)]
s2 = [[0]*(w+2) for i in range(h+2)]
s3 = [[0]*(w+2) for i in range(h+2)]
for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j] == "." and s2[i][j] == 0:
            cnt = 0
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s2[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s2[i][j] += cnt
        if s[i][j] == "." and s3[i][j] == 0:
            cnt = 0
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s3[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s3[i][j] += cnt
        ans = max(ans,1+s2[i][j]+s3[i][j])
# print(s2)
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() "#" input() input "#" s =["#"*(w+2)] + ["#"+input()+"#" for i in range(h)] + ["#"*(w+2)] s ["#"*(w+2)] + ["#"+input()+"#" for i in range(h)] + ["#"*(w+2)] ["#"*(w+2)] + ["#"+input()+"#" for i in range(h)] ["#"*(w+2)] "#"*(w+2) "#" w+2 w 2 ["#"+input()+"#" for i in range(h)] ["#"*(w+2)] "#"*(w+2) "#" w+2 w 2 ans = 1 ans 1 opt = [(0,1),(0,-1),(1,0),(-1,0)] opt [(0,1),(0,-1),(1,0),(-1,0)] (0,1) 0 1 (0,-1) 0 -1 (1,0) 1 0 (-1,0) -1 0 [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 s2 = [[0]*(w+2) for i in range(h+2)] s2 [[0]*(w+2) for i in range(h+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 s3 = [[0]*(w+2) for i in range(h+2)] s3 [[0]*(w+2) for i in range(h+2)] for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j] == "." and s2[i][j] == 0:
            cnt = 0
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s2[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s2[i][j] += cnt
        if s[i][j] == "." and s3[i][j] == 0:
            cnt = 0
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s3[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s3[i][j] += cnt
        ans = max(ans,1+s2[i][j]+s3[i][j])
# print(s2) i range(1,h+1) range 1 h+1 h 1 for j in range(1,w+1):
        if s[i][j] == "." and s2[i][j] == 0:
            cnt = 0
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s2[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s2[i][j] += cnt
        if s[i][j] == "." and s3[i][j] == 0:
            cnt = 0
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s3[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s3[i][j] += cnt
        ans = max(ans,1+s2[i][j]+s3[i][j])
# print(s2) j range(1,w+1) range 1 w+1 w 1 if s[i][j] == "." and s2[i][j] == 0:
            cnt = 0
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s2[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s2[i][j] += cnt
         s[i][j] == "." and s2[i][j] == 0 s[i][j] == "." s[i][j] [i] s i j "." s2[i][j] == 0 s2[i][j] [i] s2 i j 0 cnt = 0 cnt 0 for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
             k opt[0:2] opt 0:2 0 2 tempy = i tempy i tempx = j tempx j while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
             s[tempy+k[0]][tempx+k[1]] == "." s[tempy+k[0]][tempx+k[1]] [tempy+k[0]] s tempy+k[0] tempy k[0] k 0 tempx+k[1] tempx k[1] k 1 "." cnt += 1 cnt 1 tempy += k[0] tempy k[0] k 0 tempx += k[1] tempx k[1] k 1 for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s2[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
             k opt[0:2] opt 0:2 0 2 tempy = i tempy i tempx = j tempx j while s[tempy+k[0]][tempx+k[1]] == ".":
                    s2[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
             s[tempy+k[0]][tempx+k[1]] == "." s[tempy+k[0]][tempx+k[1]] [tempy+k[0]] s tempy+k[0] tempy k[0] k 0 tempx+k[1] tempx k[1] k 1 "." s2[tempy+k[0]][tempx+k[1]] += cnt s2[tempy+k[0]][tempx+k[1]] [tempy+k[0]] s2 tempy+k[0] tempy k[0] k 0 tempx+k[1] tempx k[1] k 1 cnt tempy += k[0] tempy k[0] k 0 tempx += k[1] tempx k[1] k 1 s2[i][j] += cnt s2[i][j] [i] s2 i j cnt if s[i][j] == "." and s3[i][j] == 0:
            cnt = 0
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s3[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s3[i][j] += cnt
         s[i][j] == "." and s3[i][j] == 0 s[i][j] == "." s[i][j] [i] s i j "." s3[i][j] == 0 s3[i][j] [i] s3 i j 0 cnt = 0 cnt 0 for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
             k opt[2:4] opt 2:4 2 4 tempy = i tempy i tempx = j tempx j while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
             s[tempy+k[0]][tempx+k[1]] == "." s[tempy+k[0]][tempx+k[1]] [tempy+k[0]] s tempy+k[0] tempy k[0] k 0 tempx+k[1] tempx k[1] k 1 "." cnt += 1 cnt 1 tempy += k[0] tempy k[0] k 0 tempx += k[1] tempx k[1] k 1 for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s3[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
             k opt[2:4] opt 2:4 2 4 tempy = i tempy i tempx = j tempx j while s[tempy+k[0]][tempx+k[1]] == ".":
                    s3[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
             s[tempy+k[0]][tempx+k[1]] == "." s[tempy+k[0]][tempx+k[1]] [tempy+k[0]] s tempy+k[0] tempy k[0] k 0 tempx+k[1] tempx k[1] k 1 "." s3[tempy+k[0]][tempx+k[1]] += cnt s3[tempy+k[0]][tempx+k[1]] [tempy+k[0]] s3 tempy+k[0] tempy k[0] k 0 tempx+k[1] tempx k[1] k 1 cnt tempy += k[0] tempy k[0] k 0 tempx += k[1] tempx k[1] k 1 s3[i][j] += cnt s3[i][j] [i] s3 i j cnt ans = max(ans,1+s2[i][j]+s3[i][j]) ans max(ans,1+s2[i][j]+s3[i][j]) max ans 1+s2[i][j]+s3[i][j] 1+s2[i][j] 1 s2[i][j] [i] s2 i j s3[i][j] [i] s3 i j print(ans) print ans s3 = [[0]*(w+2) for i in range(h+2)] [[0]*(w+2) for i in range(h+2)] s3 opt = [(0,1),(0,-1),(1,0),(-1,0)] [(0,1),(0,-1),(1,0),(-1,0)] opt cnt += 1 1 cnt tempy = i i tempy tempx += k[1] k[1] tempx tempx += k[1] k[1] tempx s2 = [[0]*(w+2) for i in range(h+2)] [[0]*(w+2) for i in range(h+2)] s2 cnt += 1 1 cnt tempx = j j tempx tempy = i i tempy cnt = 0 0 cnt tempy = i i tempy tempy += k[0] k[0] tempy tempy = i i tempy w = map(int,input().split()) map(int,input().split()) w tempy += k[0] k[0] tempy h,w = map(int,input().split()) map(int,input().split()) h tempy += k[0] k[0] tempy s =["#"*(w+2)] + ["#"+input()+"#" for i in range(h)] + ["#"*(w+2)] ["#"*(w+2)] + ["#"+input()+"#" for i in range(h)] + ["#"*(w+2)] s tempx += k[1] k[1] tempx tempx = j j tempx ans = max(ans,1+s2[i][j]+s3[i][j]) max(ans,1+s2[i][j]+s3[i][j]) ans ans = 1 1 ans tempx += k[1] k[1] tempx tempy += k[0] k[0] tempy tempx = j j tempx cnt = 0 0 cnt tempx = j j tempx
h,w = map(int,input().split())
s =["#"*(w+2)] + ["#"+input()+"#" for i in range(h)] + ["#"*(w+2)]
# print(s)
ans = 1
opt = [(0,1),(0,-1),(1,0),(-1,0)]
s2 = [[0]*(w+2) for i in range(h+2)]
s3 = [[0]*(w+2) for i in range(h+2)]
for i in range(1,h+1):
    for j in range(1,w+1):
        if s[i][j] == "." and s2[i][j] == 0:
            cnt = 0
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[0:2]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s2[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s2[i][j] += cnt
        if s[i][j] == "." and s3[i][j] == 0:
            cnt = 0
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    cnt += 1
                    tempy += k[0]
                    tempx += k[1]
            for k in opt[2:4]:
                tempy = i
                tempx = j
                while s[tempy+k[0]][tempx+k[1]] == ".":
                    s3[tempy+k[0]][tempx+k[1]] += cnt
                    tempy += k[0]
                    tempx += k[1]
            s3[i][j] += cnt
        ans = max(ans,1+s2[i][j]+s3[i][j])
# print(s2)
print(ans)