h,w = map(int,input().split())
grid = []
grid_num1 = []
grid_num2 = []
for i in range(h):
    lst = list(input())
    lst.append("#")
    grid.append(lst)
    grid_num1.append([0]*w)
grid.append(["#"]*(w+1))
for j in range(w):
    grid_num2.append([0]*h)

grid_t = [list(x) for x in zip(*grid)]

for i in range(h):
    sw = []
    tar_row = grid[i]
    for j in range(w+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
    for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num1[i][k] += r-l

for i in range(w):
    sw = []
    tar_row = grid_t[i]
    for j in range(h+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
    for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num2[i][k] += r-l
# grid_num2 = [list(x) for x in zip(*grid_num2)]

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, grid_num1[i][j] + grid_num2[j][i]-1)
print(ans)
 h,w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w grid = [] grid [] grid_num1 = [] grid_num1 [] grid_num2 = [] grid_num2 [] for i in range(h):
    lst = list(input())
    lst.append("#")
    grid.append(lst)
    grid_num1.append([0]*w) i range(h) range h lst = list(input()) lst list(input()) list input() input lst.append("#") lst.append lst append "#" grid.append(lst) grid.append grid append lst grid_num1.append([0]*w) grid_num1.append grid_num1 append [0]*w [0] 0 w grid.append(["#"]*(w+1)) grid.append grid append ["#"]*(w+1) ["#"] "#" w+1 w 1 for j in range(w):
    grid_num2.append([0]*h) j range(w) range w grid_num2.append([0]*h) grid_num2.append grid_num2 append [0]*h [0] 0 h list(x) for x in zip(*grid) for x in zip(*grid) x zip(*grid) zip *grid grid for x in zip(*grid) list(x) list x grid_t = [list(x) for x in zip(*grid)] grid_t [list(x) for x in zip(*grid)] for i in range(h):
    sw = []
    tar_row = grid[i]
    for j in range(w+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
    for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num1[i][k] += r-l i range(h) range h sw = [] sw [] tar_row = grid[i] tar_row grid[i] grid i for j in range(w+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
     j range(w+1) range w+1 w 1 if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
     j == 0 and tar_row[j] == "." j == 0 j 0 tar_row[j] == "." tar_row[j] tar_row j "." sw.append(j) sw.append sw append j elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
         tar_row[j] == "." and tar_row[j-1] == "#" tar_row[j] == "." tar_row[j] tar_row j "." tar_row[j-1] == "#" tar_row[j-1] tar_row j-1 j 1 "#" sw.append(j) sw.append sw append j elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
     tar_row[j] == "#" and tar_row[j-1] == "." tar_row[j] == "#" tar_row[j] tar_row j "#" tar_row[j-1] == "." tar_row[j-1] tar_row j-1 j 1 "." sw.append(j) sw.append sw append j for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num1[i][k] += r-l j range(0,len(sw),2) range 0 len(sw) len sw 2 l = sw[j] l sw[j] sw j r = sw[j+1] r sw[j+1] sw j+1 j 1 for k in range(l, r):
            grid_num1[i][k] += r-l k range(l, r) range l r grid_num1[i][k] += r-l grid_num1[i][k] [i] grid_num1 i k r-l r l for i in range(w):
    sw = []
    tar_row = grid_t[i]
    for j in range(h+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
    for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num2[i][k] += r-l
# grid_num2 = [list(x) for x in zip(*grid_num2)] i range(w) range w sw = [] sw [] tar_row = grid_t[i] tar_row grid_t[i] grid_t i for j in range(h+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
     j range(h+1) range h+1 h 1 if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
     j == 0 and tar_row[j] == "." j == 0 j 0 tar_row[j] == "." tar_row[j] tar_row j "." sw.append(j) sw.append sw append j elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
         tar_row[j] == "." and tar_row[j-1] == "#" tar_row[j] == "." tar_row[j] tar_row j "." tar_row[j-1] == "#" tar_row[j-1] tar_row j-1 j 1 "#" sw.append(j) sw.append sw append j elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
     tar_row[j] == "#" and tar_row[j-1] == "." tar_row[j] == "#" tar_row[j] tar_row j "#" tar_row[j-1] == "." tar_row[j-1] tar_row j-1 j 1 "." sw.append(j) sw.append sw append j for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num2[i][k] += r-l
# grid_num2 = [list(x) for x in zip(*grid_num2)] j range(0,len(sw),2) range 0 len(sw) len sw 2 l = sw[j] l sw[j] sw j r = sw[j+1] r sw[j+1] sw j+1 j 1 for k in range(l, r):
            grid_num2[i][k] += r-l
# grid_num2 = [list(x) for x in zip(*grid_num2)] k range(l, r) range l r grid_num2[i][k] += r-l grid_num2[i][k] [i] grid_num2 i k r-l r l ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, grid_num1[i][j] + grid_num2[j][i]-1) i range(h) range h for j in range(w):
        ans = max(ans, grid_num1[i][j] + grid_num2[j][i]-1) j range(w) range w ans = max(ans, grid_num1[i][j] + grid_num2[j][i]-1) ans max(ans, grid_num1[i][j] + grid_num2[j][i]-1) max ans grid_num1[i][j] + grid_num2[j][i]-1 grid_num1[i][j] + grid_num2[j][i] grid_num1[i][j] [i] grid_num1 i j grid_num2[j][i] [j] grid_num2 j i 1 print(ans) print ans ans = max(ans, grid_num1[i][j] + grid_num2[j][i]-1) max(ans, grid_num1[i][j] + grid_num2[j][i]-1) ans r = sw[j+1] sw[j+1] r tar_row = grid[i] grid[i] tar_row h,w = map(int,input().split()) map(int,input().split()) h r = sw[j+1] sw[j+1] r lst = list(input()) list(input()) lst grid_num1 = [] [] grid_num1 sw = [] [] sw grid = [] [] grid grid_num2 = [] [] grid_num2 l = sw[j] sw[j] l sw = [] [] sw w = map(int,input().split()) map(int,input().split()) w l = sw[j] sw[j] l ans = 0 0 ans grid_t = [list(x) for x in zip(*grid)] [list(x) for x in zip(*grid)] grid_t tar_row = grid_t[i] grid_t[i] tar_row
h,w = map(int,input().split())
grid = []
grid_num1 = []
grid_num2 = []
for i in range(h):
    lst = list(input())
    lst.append("#")
    grid.append(lst)
    grid_num1.append([0]*w)
grid.append(["#"]*(w+1))
for j in range(w):
    grid_num2.append([0]*h)

grid_t = [list(x) for x in zip(*grid)]

for i in range(h):
    sw = []
    tar_row = grid[i]
    for j in range(w+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
    for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num1[i][k] += r-l

for i in range(w):
    sw = []
    tar_row = grid_t[i]
    for j in range(h+1):
        if j == 0 and tar_row[j] == ".":
            sw.append(j)
        elif tar_row[j] == "." and tar_row[j-1] == "#":
            sw.append(j)
        elif tar_row[j] == "#" and tar_row[j-1] == ".":
            sw.append(j)
    for j in range(0,len(sw),2):
        l = sw[j]
        r = sw[j+1]
        for k in range(l, r):
            grid_num2[i][k] += r-l
# grid_num2 = [list(x) for x in zip(*grid_num2)]

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

