h,w = map(int,input().split())
s = [input() for _ in range(h)]

l = [[0] * w for _ in range(h)]
r = [[0] * w for _ in range(h)]
u = [[0] * w for _ in range(h)]
d = [[0] * w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            l[i][j] = 0
        else:
            if j == 0:
                l[i][j] = 1
            else:
                l[i][j] = l[i][j-1] + 1

for i in range(h):
    for j in range(w-1, -1, -1):
        if s[i][j] == '#':
            r[i][j] = 0
        else:
            if j == w-1:
                r[i][j] = 1
            else:
                r[i][j] = r[i][j+1] + 1

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            u[i][j] = 0
        else:
            if i == 0:
                u[i][j] = 1
            else:
                u[i][j] = u[i-1][j] + 1

for i in range(h-1, -1 ,-1):
    for j in range(w):
        if s[i][j] == '#':
            d[i][j] = 0
        else:
            if i == h-1:
                d[i][j] = 1
            else:
                d[i][j] = d[i+1][j] + 1

ans = 0

for i in range(h):
    for j in range(w):
        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3)

print(ans) h,w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w input() for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) input() input s = [input() for _ in range(h)] s [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 l = [[0] * w for _ in range(h)] l [[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 = [[0] * w for _ in range(h)] r [[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 u = [[0] * w for _ in range(h)] u [[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 = [[0] * w for _ in range(h)] d [[0] * w for _ in range(h)] for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            l[i][j] = 0
        else:
            if j == 0:
                l[i][j] = 1
            else:
                l[i][j] = l[i][j-1] + 1 i range(h) range h for j in range(w):
        if s[i][j] == '#':
            l[i][j] = 0
        else:
            if j == 0:
                l[i][j] = 1
            else:
                l[i][j] = l[i][j-1] + 1 j range(w) range w if s[i][j] == '#':
            l[i][j] = 0
        else:
            if j == 0:
                l[i][j] = 1
            else:
                l[i][j] = l[i][j-1] + 1 s[i][j] == '#' s[i][j] [i] s i j '#' l[i][j] = 0 l[i][j] [i] l i j 0 if j == 0:
                l[i][j] = 1
            else:
                l[i][j] = l[i][j-1] + 1 j == 0 j 0 l[i][j] = 1 l[i][j] [i] l i j 1 l[i][j] = l[i][j-1] + 1 l[i][j] [i] l i j l[i][j-1] + 1 l[i][j-1] [i] l i j-1 j 1 1 for i in range(h):
    for j in range(w-1, -1, -1):
        if s[i][j] == '#':
            r[i][j] = 0
        else:
            if j == w-1:
                r[i][j] = 1
            else:
                r[i][j] = r[i][j+1] + 1 i range(h) range h for j in range(w-1, -1, -1):
        if s[i][j] == '#':
            r[i][j] = 0
        else:
            if j == w-1:
                r[i][j] = 1
            else:
                r[i][j] = r[i][j+1] + 1 j range(w-1, -1, -1) range w-1 w 1 -1 -1 if s[i][j] == '#':
            r[i][j] = 0
        else:
            if j == w-1:
                r[i][j] = 1
            else:
                r[i][j] = r[i][j+1] + 1 s[i][j] == '#' s[i][j] [i] s i j '#' r[i][j] = 0 r[i][j] [i] r i j 0 if j == w-1:
                r[i][j] = 1
            else:
                r[i][j] = r[i][j+1] + 1 j == w-1 j w-1 w 1 r[i][j] = 1 r[i][j] [i] r i j 1 r[i][j] = r[i][j+1] + 1 r[i][j] [i] r i j r[i][j+1] + 1 r[i][j+1] [i] r i j+1 j 1 1 for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            u[i][j] = 0
        else:
            if i == 0:
                u[i][j] = 1
            else:
                u[i][j] = u[i-1][j] + 1 i range(h) range h for j in range(w):
        if s[i][j] == '#':
            u[i][j] = 0
        else:
            if i == 0:
                u[i][j] = 1
            else:
                u[i][j] = u[i-1][j] + 1 j range(w) range w if s[i][j] == '#':
            u[i][j] = 0
        else:
            if i == 0:
                u[i][j] = 1
            else:
                u[i][j] = u[i-1][j] + 1 s[i][j] == '#' s[i][j] [i] s i j '#' u[i][j] = 0 u[i][j] [i] u i j 0 if i == 0:
                u[i][j] = 1
            else:
                u[i][j] = u[i-1][j] + 1 i == 0 i 0 u[i][j] = 1 u[i][j] [i] u i j 1 u[i][j] = u[i-1][j] + 1 u[i][j] [i] u i j u[i-1][j] + 1 u[i-1][j] [i-1] u i-1 i 1 j 1 for i in range(h-1, -1 ,-1):
    for j in range(w):
        if s[i][j] == '#':
            d[i][j] = 0
        else:
            if i == h-1:
                d[i][j] = 1
            else:
                d[i][j] = d[i+1][j] + 1 i range(h-1, -1 ,-1) range h-1 h 1 -1 -1 for j in range(w):
        if s[i][j] == '#':
            d[i][j] = 0
        else:
            if i == h-1:
                d[i][j] = 1
            else:
                d[i][j] = d[i+1][j] + 1 j range(w) range w if s[i][j] == '#':
            d[i][j] = 0
        else:
            if i == h-1:
                d[i][j] = 1
            else:
                d[i][j] = d[i+1][j] + 1 s[i][j] == '#' s[i][j] [i] s i j '#' d[i][j] = 0 d[i][j] [i] d i j 0 if i == h-1:
                d[i][j] = 1
            else:
                d[i][j] = d[i+1][j] + 1 i == h-1 i h-1 h 1 d[i][j] = 1 d[i][j] [i] d i j 1 d[i][j] = d[i+1][j] + 1 d[i][j] [i] d i j d[i+1][j] + 1 d[i+1][j] [i+1] d i+1 i 1 j 1 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3) i range(h) range h for j in range(w):
        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3) j range(w) range w ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3) ans max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3) max ans l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3 l[i][j] + r[i][j] + u[i][j] + d[i][j] l[i][j] + r[i][j] + u[i][j] l[i][j] + r[i][j] l[i][j] [i] l i j r[i][j] [i] r i j u[i][j] [i] u i j d[i][j] [i] d i j 3 print(ans) print ans r = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] r d = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] d ans = 0 0 ans h,w = map(int,input().split()) map(int,input().split()) h w = map(int,input().split()) map(int,input().split()) w s = [input() for _ in range(h)] [input() for _ in range(h)] s u = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] u l = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] l ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3) max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3) ans
h,w = map(int,input().split())
s = [input() for _ in range(h)]

l = [[0] * w for _ in range(h)]
r = [[0] * w for _ in range(h)]
u = [[0] * w for _ in range(h)]
d = [[0] * w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            l[i][j] = 0
        else:
            if j == 0:
                l[i][j] = 1
            else:
                l[i][j] = l[i][j-1] + 1

for i in range(h):
    for j in range(w-1, -1, -1):
        if s[i][j] == '#':
            r[i][j] = 0
        else:
            if j == w-1:
                r[i][j] = 1
            else:
                r[i][j] = r[i][j+1] + 1

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            u[i][j] = 0
        else:
            if i == 0:
                u[i][j] = 1
            else:
                u[i][j] = u[i-1][j] + 1

for i in range(h-1, -1 ,-1):
    for j in range(w):
        if s[i][j] == '#':
            d[i][j] = 0
        else:
            if i == h-1:
                d[i][j] = 1
            else:
                d[i][j] = d[i+1][j] + 1

ans = 0

for i in range(h):
    for j in range(w):
        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3)

print(ans)
