h , w = map(int,input().split())
giri = [list(input()) for i in range(h)]
ans = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    sta = -1
    cou = 0
    for j in range(w):
        if sta == -1 and giri[i][j] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[i][j] == ".":
            cou += 1
        elif sta != -1 and giri[i][j] == "#":
            for k in range(sta,j):
                ans[i][k] += cou
            cou = 0
            sta = -1
        if j == w-1 and sta != -1:
            for k in range(sta,w):
                ans[i][k] += cou

for i in range(w):
    sta = -1
    cou = 0
    for j in range(h):
        if sta == -1 and giri[j][i] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[j][i] == ".":
            cou += 1
        elif sta != -1 and giri[j][i] == "#":
            for k in range(sta,j):
                ans[k][i] += cou
            cou = 0
            sta = -1
        if j == h-1 and sta != -1:
            for k in range(sta,h):
                ans[k][i] += cou

kotae = 0

for i in range(h):
    for j in range(w):
        kotae = max(kotae,ans[i][j]-1)

print(kotae) h , w = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w list(input()) for i in range(h) for i in range(h) i range(h) range h for i in range(h) list(input()) list input() input giri = [list(input()) for i in range(h)] giri [list(input()) for i in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] ans = [[0 for i in range(w)] for j in range(h)] ans [[0 for i in range(w)] for j in range(h)] for i in range(h):
    sta = -1
    cou = 0
    for j in range(w):
        if sta == -1 and giri[i][j] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[i][j] == ".":
            cou += 1
        elif sta != -1 and giri[i][j] == "#":
            for k in range(sta,j):
                ans[i][k] += cou
            cou = 0
            sta = -1
        if j == w-1 and sta != -1:
            for k in range(sta,w):
                ans[i][k] += cou i range(h) range h sta = -1 sta -1 cou = 0 cou 0 for j in range(w):
        if sta == -1 and giri[i][j] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[i][j] == ".":
            cou += 1
        elif sta != -1 and giri[i][j] == "#":
            for k in range(sta,j):
                ans[i][k] += cou
            cou = 0
            sta = -1
        if j == w-1 and sta != -1:
            for k in range(sta,w):
                ans[i][k] += cou j range(w) range w if sta == -1 and giri[i][j] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[i][j] == ".":
            cou += 1
        elif sta != -1 and giri[i][j] == "#":
            for k in range(sta,j):
                ans[i][k] += cou
            cou = 0
            sta = -1
         sta == -1 and giri[i][j] == "." sta == -1 sta -1 giri[i][j] == "." giri[i][j] [i] giri i j "." sta = j sta j cou += 1 cou 1 elif sta != -1 and giri[i][j] == ".":
            cou += 1
         sta != -1 and giri[i][j] == "." sta != -1 sta -1 giri[i][j] == "." giri[i][j] [i] giri i j "." cou += 1 cou 1 elif sta != -1 and giri[i][j] == "#":
            for k in range(sta,j):
                ans[i][k] += cou
            cou = 0
            sta = -1
         sta != -1 and giri[i][j] == "#" sta != -1 sta -1 giri[i][j] == "#" giri[i][j] [i] giri i j "#" for k in range(sta,j):
                ans[i][k] += cou
             k range(sta,j) range sta j ans[i][k] += cou ans[i][k] [i] ans i k cou cou = 0 cou 0 sta = -1 sta -1 if j == w-1 and sta != -1:
            for k in range(sta,w):
                ans[i][k] += cou j == w-1 and sta != -1 j == w-1 j w-1 w 1 sta != -1 sta -1 for k in range(sta,w):
                ans[i][k] += cou k range(sta,w) range sta w ans[i][k] += cou ans[i][k] [i] ans i k cou for i in range(w):
    sta = -1
    cou = 0
    for j in range(h):
        if sta == -1 and giri[j][i] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[j][i] == ".":
            cou += 1
        elif sta != -1 and giri[j][i] == "#":
            for k in range(sta,j):
                ans[k][i] += cou
            cou = 0
            sta = -1
        if j == h-1 and sta != -1:
            for k in range(sta,h):
                ans[k][i] += cou i range(w) range w sta = -1 sta -1 cou = 0 cou 0 for j in range(h):
        if sta == -1 and giri[j][i] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[j][i] == ".":
            cou += 1
        elif sta != -1 and giri[j][i] == "#":
            for k in range(sta,j):
                ans[k][i] += cou
            cou = 0
            sta = -1
        if j == h-1 and sta != -1:
            for k in range(sta,h):
                ans[k][i] += cou j range(h) range h if sta == -1 and giri[j][i] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[j][i] == ".":
            cou += 1
        elif sta != -1 and giri[j][i] == "#":
            for k in range(sta,j):
                ans[k][i] += cou
            cou = 0
            sta = -1
         sta == -1 and giri[j][i] == "." sta == -1 sta -1 giri[j][i] == "." giri[j][i] [j] giri j i "." sta = j sta j cou += 1 cou 1 elif sta != -1 and giri[j][i] == ".":
            cou += 1
         sta != -1 and giri[j][i] == "." sta != -1 sta -1 giri[j][i] == "." giri[j][i] [j] giri j i "." cou += 1 cou 1 elif sta != -1 and giri[j][i] == "#":
            for k in range(sta,j):
                ans[k][i] += cou
            cou = 0
            sta = -1
         sta != -1 and giri[j][i] == "#" sta != -1 sta -1 giri[j][i] == "#" giri[j][i] [j] giri j i "#" for k in range(sta,j):
                ans[k][i] += cou
             k range(sta,j) range sta j ans[k][i] += cou ans[k][i] [k] ans k i cou cou = 0 cou 0 sta = -1 sta -1 if j == h-1 and sta != -1:
            for k in range(sta,h):
                ans[k][i] += cou j == h-1 and sta != -1 j == h-1 j h-1 h 1 sta != -1 sta -1 for k in range(sta,h):
                ans[k][i] += cou k range(sta,h) range sta h ans[k][i] += cou ans[k][i] [k] ans k i cou kotae = 0 kotae 0 for i in range(h):
    for j in range(w):
        kotae = max(kotae,ans[i][j]-1) i range(h) range h for j in range(w):
        kotae = max(kotae,ans[i][j]-1) j range(w) range w kotae = max(kotae,ans[i][j]-1) kotae max(kotae,ans[i][j]-1) max kotae ans[i][j]-1 ans[i][j] [i] ans i j 1 print(kotae) print kotae sta = j j sta kotae = 0 0 kotae cou = 0 0 cou sta = -1 -1 sta kotae = max(kotae,ans[i][j]-1) max(kotae,ans[i][j]-1) kotae ans = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] ans cou += 1 1 cou cou = 0 0 cou cou += 1 1 cou sta = j j sta h , w = map(int,input().split()) map(int,input().split()) h cou += 1 1 cou sta = -1 -1 sta giri = [list(input()) for i in range(h)] [list(input()) for i in range(h)] giri cou = 0 0 cou sta = -1 -1 sta w = map(int,input().split()) map(int,input().split()) w cou = 0 0 cou sta = -1 -1 sta cou += 1 1 cou
h , w = map(int,input().split())
giri = [list(input()) for i in range(h)]
ans = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    sta = -1
    cou = 0
    for j in range(w):
        if sta == -1 and giri[i][j] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[i][j] == ".":
            cou += 1
        elif sta != -1 and giri[i][j] == "#":
            for k in range(sta,j):
                ans[i][k] += cou
            cou = 0
            sta = -1
        if j == w-1 and sta != -1:
            for k in range(sta,w):
                ans[i][k] += cou

for i in range(w):
    sta = -1
    cou = 0
    for j in range(h):
        if sta == -1 and giri[j][i] == ".":
            sta = j
            cou += 1
        elif sta != -1 and giri[j][i] == ".":
            cou += 1
        elif sta != -1 and giri[j][i] == "#":
            for k in range(sta,j):
                ans[k][i] += cou
            cou = 0
            sta = -1
        if j == h-1 and sta != -1:
            for k in range(sta,h):
                ans[k][i] += cou

kotae = 0

for i in range(h):
    for j in range(w):
        kotae = max(kotae,ans[i][j]-1)

print(kotae)