h,w = map(int,input().split())
s = [0]*h
for i in range(h):
    s[i] = list(input())
ver = [[0 for j in range(w)] for i in range(h)]
hol = [[0 for j in range(w)] for i in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            pass
        elif j >= 1 and hol[i][j-1] != 0:
            hol[i][j] = hol[i][j-1]
        else:
            for k in range(2000):
                if j+k+1 >= w:
                    break
                if s[i][j+k+1] == "#":
                    break
            hol[i][j] = k+1
            
for j in range(w):
    for i in range(h):
        if s[i][j] == "#":
            pass
        elif ver[i][j] == 0 and i >= 1 and ver[i-1][j] != 0:
            ver[i][j] = ver[i-1][j]
        else:
            for k in range(2000):
                if i+k+1 >= h:
                    break
                elif s[i+k+1][j] == "#":
                    break
            ver[i][j] = k+1

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, hol[i][j] + ver[i][j] - 1)
print(ans) h,w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w s = [0]*h s [0]*h [0] 0 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 [0 for j in range(w)] for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0 for j in range(w)] ver = [[0 for j in range(w)] for i in range(h)] ver [[0 for j in range(w)] for i in range(h)] [0 for j in range(w)] for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0 for j in range(w)] hol = [[0 for j in range(w)] for i in range(h)] hol [[0 for j in range(w)] for i in range(h)] for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            pass
        elif j >= 1 and hol[i][j-1] != 0:
            hol[i][j] = hol[i][j-1]
        else:
            for k in range(2000):
                if j+k+1 >= w:
                    break
                if s[i][j+k+1] == "#":
                    break
            hol[i][j] = k+1
             i range(h) range h for j in range(w):
        if s[i][j] == "#":
            pass
        elif j >= 1 and hol[i][j-1] != 0:
            hol[i][j] = hol[i][j-1]
        else:
            for k in range(2000):
                if j+k+1 >= w:
                    break
                if s[i][j+k+1] == "#":
                    break
            hol[i][j] = k+1
             j range(w) range w if s[i][j] == "#":
            pass
        elif j >= 1 and hol[i][j-1] != 0:
            hol[i][j] = hol[i][j-1]
        else:
            for k in range(2000):
                if j+k+1 >= w:
                    break
                if s[i][j+k+1] == "#":
                    break
            hol[i][j] = k+1
             s[i][j] == "#" s[i][j] [i] s i j "#" elif j >= 1 and hol[i][j-1] != 0:
            hol[i][j] = hol[i][j-1]
         j >= 1 and hol[i][j-1] != 0 j >= 1 j 1 hol[i][j-1] != 0 hol[i][j-1] [i] hol i j-1 j 1 0 hol[i][j] = hol[i][j-1] hol[i][j] [i] hol i j hol[i][j-1] [i] hol i j-1 j 1 for k in range(2000):
                if j+k+1 >= w:
                    break
                if s[i][j+k+1] == "#":
                    break
             k range(2000) range 2000 if j+k+1 >= w:
                    break
                 j+k+1 >= w j+k+1 j+k j k 1 w break if s[i][j+k+1] == "#":
                    break
             s[i][j+k+1] == "#" s[i][j+k+1] [i] s i j+k+1 j+k j k 1 "#" break hol[i][j] = k+1 hol[i][j] [i] hol i j k+1 k 1 for j in range(w):
    for i in range(h):
        if s[i][j] == "#":
            pass
        elif ver[i][j] == 0 and i >= 1 and ver[i-1][j] != 0:
            ver[i][j] = ver[i-1][j]
        else:
            for k in range(2000):
                if i+k+1 >= h:
                    break
                elif s[i+k+1][j] == "#":
                    break
            ver[i][j] = k+1 j range(w) range w for i in range(h):
        if s[i][j] == "#":
            pass
        elif ver[i][j] == 0 and i >= 1 and ver[i-1][j] != 0:
            ver[i][j] = ver[i-1][j]
        else:
            for k in range(2000):
                if i+k+1 >= h:
                    break
                elif s[i+k+1][j] == "#":
                    break
            ver[i][j] = k+1 i range(h) range h if s[i][j] == "#":
            pass
        elif ver[i][j] == 0 and i >= 1 and ver[i-1][j] != 0:
            ver[i][j] = ver[i-1][j]
        else:
            for k in range(2000):
                if i+k+1 >= h:
                    break
                elif s[i+k+1][j] == "#":
                    break
            ver[i][j] = k+1 s[i][j] == "#" s[i][j] [i] s i j "#" elif ver[i][j] == 0 and i >= 1 and ver[i-1][j] != 0:
            ver[i][j] = ver[i-1][j]
         ver[i][j] == 0 and i >= 1 and ver[i-1][j] != 0 ver[i][j] == 0 and i >= 1 ver[i][j] == 0 ver[i][j] [i] ver i j 0 i >= 1 i 1 ver[i-1][j] != 0 ver[i-1][j] [i-1] ver i-1 i 1 j 0 ver[i][j] = ver[i-1][j] ver[i][j] [i] ver i j ver[i-1][j] [i-1] ver i-1 i 1 j for k in range(2000):
                if i+k+1 >= h:
                    break
                elif s[i+k+1][j] == "#":
                    break
             k range(2000) range 2000 if i+k+1 >= h:
                    break
                elif s[i+k+1][j] == "#":
                    break
             i+k+1 >= h i+k+1 i+k i k 1 h break elif s[i+k+1][j] == "#":
                    break
             s[i+k+1][j] == "#" s[i+k+1][j] [i+k+1] s i+k+1 i+k i k 1 j "#" break ver[i][j] = k+1 ver[i][j] [i] ver i j k+1 k 1 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, hol[i][j] + ver[i][j] - 1) i range(h) range h for j in range(w):
        ans = max(ans, hol[i][j] + ver[i][j] - 1) j range(w) range w ans = max(ans, hol[i][j] + ver[i][j] - 1) ans max(ans, hol[i][j] + ver[i][j] - 1) max ans hol[i][j] + ver[i][j] - 1 hol[i][j] + ver[i][j] hol[i][j] [i] hol i j ver[i][j] [i] ver i j 1 print(ans) print ans ver = [[0 for j in range(w)] for i in range(h)] [[0 for j in range(w)] for i in range(h)] ver s = [0]*h [0]*h s ans = 0 0 ans h,w = map(int,input().split()) map(int,input().split()) h hol = [[0 for j in range(w)] for i in range(h)] [[0 for j in range(w)] for i in range(h)] hol w = map(int,input().split()) map(int,input().split()) w ans = max(ans, hol[i][j] + ver[i][j] - 1) max(ans, hol[i][j] + ver[i][j] - 1) ans
h,w = map(int,input().split())
s = [0]*h
for i in range(h):
    s[i] = list(input())
ver = [[0 for j in range(w)] for i in range(h)]
hol = [[0 for j in range(w)] for i in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            pass
        elif j >= 1 and hol[i][j-1] != 0:
            hol[i][j] = hol[i][j-1]
        else:
            for k in range(2000):
                if j+k+1 >= w:
                    break
                if s[i][j+k+1] == "#":
                    break
            hol[i][j] = k+1
            
for j in range(w):
    for i in range(h):
        if s[i][j] == "#":
            pass
        elif ver[i][j] == 0 and i >= 1 and ver[i-1][j] != 0:
            ver[i][j] = ver[i-1][j]
        else:
            for k in range(2000):
                if i+k+1 >= h:
                    break
                elif s[i+k+1][j] == "#":
                    break
            ver[i][j] = k+1

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, hol[i][j] + ver[i][j] - 1)
print(ans)